Clean up 65/66265/1
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Wed, 6 Dec 2017 09:11:47 +0000 (10:11 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Wed, 6 Dec 2017 09:15:14 +0000 (10:15 +0100)
- remove unused imports
- static declared as final
- unnecesary private
- remove deprecated checkedFuture

Change-Id: I4def646d01969755394970661b81f21aa9827690
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
13 files changed:
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractOperandParser.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv4/FlowspecIpv4NlriParserHelper.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/ipv6/FlowspecIpv6NlriParserHelper.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/tlvs/AbstractNodeDescriptorTlvCodec.java
bgp/path-selection-mode/src/main/java/org/opendaylight/protocol/bgp/mode/spi/AbstractRouteEntry.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/AbstractReflectingExportPolicy.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBImpl.java
bgp/topology-provider/src/main/java/org/opendaylight/bgpcep/bgp/topology/provider/spi/BgpTopologyDeployer.java
bmp/bmp-parser-impl/src/test/java/org/opendaylight/protocol/bmp/parser/message/TestUtil.java
pcep/api/src/main/java/org/opendaylight/protocol/pcep/TerminationReason.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/AbstractMessageParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPErrors.java

index 64f483054ded1998e0b4f24a2c0ee40620df0306..cde6b0bf993c083706cbe09a523df8f6931b3a51 100644 (file)
@@ -568,7 +568,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
         return buffer.toString();
     }
 
-    public static final int readNlriLength(@Nonnull final ByteBuf nlri) {
+    public static int readNlriLength(@Nonnull final ByteBuf nlri) {
         requireNonNull(nlri, "NLRI information cannot be null");
         Preconditions.checkState(nlri.isReadable(), "NLRI Byte buffer is not readable.");
         int length = nlri.readUnsignedByte();
@@ -638,7 +638,7 @@ public abstract class AbstractFlowspecNlriParser implements NlriParser, NlriSeri
     }
 
     @Nullable
-    protected static final PathId readPathId(@Nonnull final ByteBuf nlri, final Class<? extends AddressFamily> afi,
+    protected static PathId readPathId(@Nonnull final ByteBuf nlri, final Class<? extends AddressFamily> afi,
             final Class<? extends SubsequentAddressFamily> safi, final PeerSpecificParserConstraint constraint) {
         if (MultiPathSupportUtil.isTableTypeSupported(constraint, new BgpTableTypeImpl(afi, safi))) {
             return PathIdUtil.readPathId(nlri);
index 7bedbb193f1bf5595265d884fad958cb4a67de1b..7e5d01844a8800453e89635c62b480ab82326924 100644 (file)
@@ -33,7 +33,7 @@ public abstract class AbstractOperandParser<T> {
     private static final int LENGTH_BITMASK = 48;
 
     @VisibleForTesting
-    public static final short parseLength(final byte op) {
+    public static short parseLength(final byte op) {
         return (short) (1 << ((op & LENGTH_BITMASK) >> LENGTH_SHIFT));
     }
 
index 3a84a540aa42ca97e8157cf8ba80b4afb8af4719..7c22de524e815f46b7efd005a9e1681a78a4521c 100644 (file)
@@ -40,7 +40,7 @@ public final class FlowspecIpv4NlriParserHelper {
 
     private FlowspecIpv4NlriParserHelper() {}
 
-    public static final void extractFlowspec(final ChoiceNode fsType, final FlowspecBuilder fsBuilder) {
+    public static void extractFlowspec(final ChoiceNode fsType, final FlowspecBuilder fsBuilder) {
         if (fsType.getChild(AbstractFlowspecNlriParser.DEST_PREFIX_NID).isPresent()) {
             fsBuilder.setFlowspecType(
                 new DestinationPrefixCaseBuilder()
@@ -60,7 +60,7 @@ public final class FlowspecIpv4NlriParserHelper {
         }
     }
 
-    public static final void buildFlowspecString(final FlowspecType value, final StringBuilder buffer) {
+    public static void buildFlowspecString(final FlowspecType value, final StringBuilder buffer) {
         if (value instanceof DestinationPrefixCase) {
             buffer.append("to ");
             buffer.append(((DestinationPrefixCase) value).getDestinationPrefix().getValue());
@@ -73,7 +73,7 @@ public final class FlowspecIpv4NlriParserHelper {
         }
     }
 
-    private static final List<ProtocolIps> createProtocolsIps(final UnkeyedListNode protocolIpsData) {
+    private static List<ProtocolIps> createProtocolsIps(final UnkeyedListNode protocolIpsData) {
         final List<ProtocolIps> protocolIps = new ArrayList<>();
 
         for (final UnkeyedListEntryNode node : protocolIpsData.getValue()) {
index 99c9f01c9790af254e25f80dc9a3a82255393021..6209580fd2f1785e695dc6ef8a24c5fc3fab407a 100644 (file)
@@ -42,7 +42,7 @@ public final class FlowspecIpv6NlriParserHelper {
 
     private FlowspecIpv6NlriParserHelper() {}
 
-    public static final void extractFlowspec(final ChoiceNode fsType, final FlowspecBuilder fsBuilder) {
+    public static void extractFlowspec(final ChoiceNode fsType, final FlowspecBuilder fsBuilder) {
         if (fsType.getChild(AbstractFlowspecNlriParser.DEST_PREFIX_NID).isPresent()) {
             fsBuilder.setFlowspecType(
                 new DestinationIpv6PrefixCaseBuilder()
@@ -62,7 +62,7 @@ public final class FlowspecIpv6NlriParserHelper {
         }
     }
 
-    public static final void buildFlowspecString(final FlowspecType value, final StringBuilder buffer) {
+    public static void buildFlowspecString(final FlowspecType value, final StringBuilder buffer) {
         if (value instanceof DestinationIpv6PrefixCase) {
             buffer.append("to ");
             buffer.append(((DestinationIpv6PrefixCase) value).getDestinationPrefix().getValue());
@@ -78,7 +78,7 @@ public final class FlowspecIpv6NlriParserHelper {
         }
     }
 
-    private static final List<NextHeaders> createNextHeaders(final UnkeyedListNode nextHeadersData) {
+    private static List<NextHeaders> createNextHeaders(final UnkeyedListNode nextHeadersData) {
         final List<NextHeaders> nextHeaders = new ArrayList<>();
 
         for (final UnkeyedListEntryNode node : nextHeadersData.getValue()) {
@@ -97,7 +97,7 @@ public final class FlowspecIpv6NlriParserHelper {
         return nextHeaders;
     }
 
-    private static final List<FlowLabel> createFlowLabels(final UnkeyedListNode flowLabelsData) {
+    private static List<FlowLabel> createFlowLabels(final UnkeyedListNode flowLabelsData) {
         final List<FlowLabel> flowLabels = new ArrayList<>();
 
         for (final UnkeyedListEntryNode node : flowLabelsData.getValue()) {
@@ -116,7 +116,7 @@ public final class FlowspecIpv6NlriParserHelper {
         return flowLabels;
     }
 
-    private static final String stringFlowLabel(final List<FlowLabel> list) {
+    private static String stringFlowLabel(final List<FlowLabel> list) {
         final StringBuilder buffer = new StringBuilder();
         boolean isFirst = true;
         for (final FlowLabel item : list) {
index 397fe1c63384c4117fe3ede70428edba906187e9..12804b10eef9b7bada7cd56ba95ba2372febac06 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 import org.opendaylight.yangtools.yang.common.QName;
 
 abstract class AbstractNodeDescriptorTlvCodec {
-    protected static final NodeIdentifier parseNodeDescriptor(final ByteBuf value, final Map<QName, Object> parsedSubTlvs) {
+    protected static NodeIdentifier parseNodeDescriptor(final ByteBuf value, final Map<QName, Object> parsedSubTlvs) {
         parsedSubTlvs.putAll(SimpleNlriTypeRegistry.getInstance().parseSubTlvs(value));
         final AsNumber asNumber = (AsNumber) parsedSubTlvs.get(AsNumTlvParser.AS_NUMBER_QNAME);
         final DomainIdentifier domainId = (DomainIdentifier) parsedSubTlvs.get(DomainIdTlvParser.DOMAIN_ID_QNAME);
@@ -51,7 +51,7 @@ abstract class AbstractNodeDescriptorTlvCodec {
         };
     }
 
-    protected static final void serializeNodeDescriptor(final NodeIdentifier tlv, final ByteBuf body) {
+    protected static void serializeNodeDescriptor(final NodeIdentifier tlv, final ByteBuf body) {
         final SimpleNlriTypeRegistry tlvReg = SimpleNlriTypeRegistry.getInstance();
         tlvReg.serializeTlv(AsNumTlvParser.AS_NUMBER_QNAME, tlv.getAsNumber(), body);
         tlvReg.serializeTlv(DomainIdTlvParser.DOMAIN_ID_QNAME, tlv.getDomainId(), body);
index 4297b1dca5f7d4772d88bb623de8b9949150209b..8281e3cb2599cb89c55c61609369e5eb31c78a26 100644 (file)
@@ -33,7 +33,7 @@ public abstract class AbstractRouteEntry implements RouteEntry {
     protected static final NodeIdentifier ROUTES_IDENTIFIER = new NodeIdentifier(Routes.QNAME);
     private static final Logger LOG = LoggerFactory.getLogger(AbstractRouteEntry.class);
 
-    protected static final void fillLocRib(final YangInstanceIdentifier routeTarget, final NormalizedNode<?, ?> value,
+    protected static void fillLocRib(final YangInstanceIdentifier routeTarget, final NormalizedNode<?, ?> value,
             final DOMDataWriteTransaction tx) {
         if (value != null) {
             LOG.debug("Write route to LocRib {}", value);
@@ -44,7 +44,7 @@ public abstract class AbstractRouteEntry implements RouteEntry {
         }
     }
 
-    protected static final void update(final PeerId destPeer, final YangInstanceIdentifier routeTarget,
+    protected static void update(final PeerId destPeer, final YangInstanceIdentifier routeTarget,
             final ContainerNode effAttr, final NormalizedNode<?, ?> value, final RIBSupport ribSup,
             final DOMDataWriteTransaction tx) {
         if (!writeRoute(destPeer, routeTarget, effAttr, value, ribSup, tx)) {
@@ -52,7 +52,7 @@ public abstract class AbstractRouteEntry implements RouteEntry {
         }
     }
 
-    protected static final boolean writeRoute(final PeerId destPeer, final YangInstanceIdentifier routeTarget,
+    protected static boolean writeRoute(final PeerId destPeer, final YangInstanceIdentifier routeTarget,
             final ContainerNode effAttrib, final NormalizedNode<?, ?> value, final RIBSupport ribSup,
             final DOMDataWriteTransaction tx) {
         if (effAttrib != null && value != null) {
@@ -70,7 +70,7 @@ public abstract class AbstractRouteEntry implements RouteEntry {
         tx.delete(LogicalDatastoreType.OPERATIONAL, routeTarget);
     }
 
-    protected static final boolean filterRoutes(final PeerId rootPeer, final PeerId destPeer,
+    protected static boolean filterRoutes(final PeerId rootPeer, final PeerId destPeer,
             final ExportPolicyPeerTracker peerPT, final TablesKey localTK, final PeerRole destPeerRole) {
         return !rootPeer.equals(destPeer) && isTableSupportedAndReady(destPeer, peerPT, localTK) && !PeerRole.Internal.equals(destPeerRole);
     }
@@ -83,7 +83,7 @@ public abstract class AbstractRouteEntry implements RouteEntry {
         return true;
     }
 
-    protected static final YangInstanceIdentifier getAdjRibOutYII(final RIBSupport ribSup,
+    protected static YangInstanceIdentifier getAdjRibOutYII(final RIBSupport ribSup,
             final YangInstanceIdentifier rootPath, final PathArgument routeId, final TablesKey localTK) {
         return ribSup.routePath(rootPath.node(AdjRibOut.QNAME).node(Tables.QNAME).node(RibSupportUtils.toYangTablesKey(localTK))
             .node(ROUTES_IDENTIFIER), routeId);
index ce5a034ec0e19fc4b9e07d304302cfd2f7808f25..338d66ad1e959cf221625b7cd1af9d811776ae74 100644 (file)
@@ -44,7 +44,7 @@ abstract class AbstractReflectingExportPolicy extends AbstractExportPolicy {
      * @param attributes Input attributes, may not be null.
      * @return Modified (reflected) attributes.
      */
-    @Nonnull protected static final ContainerNode reflectedFromInternalAttributes(@Nonnull final ContainerNode attributes) {
+    @Nonnull protected static ContainerNode reflectedFromInternalAttributes(@Nonnull final ContainerNode attributes) {
         return AttributeOperations.getInstance(attributes).reflectedAttributes(attributes);
     }
 }
index 0a66e055ffc4499f2abd5b0b0e2fbc067db050ee..1ce2764b4bae1d5b61a6eae33960ead91983dc30 100755 (executable)
@@ -358,7 +358,7 @@ public final class RIBImpl extends BGPRIBStateImpl implements ClusterSingletonSe
 
         final DOMDataWriteTransaction t = this.domChain.newWriteOnlyTransaction();
         t.delete(LogicalDatastoreType.OPERATIONAL, getYangRibId());
-        final CheckedFuture<Void, TransactionCommitFailedException> cleanFuture = t.submit();
+        final ListenableFuture<Void> cleanFuture = t.submit();
 
         this.domChain.close();
         return cleanFuture;
index 89027fe805acdfdace2ec3181f3df3c235f572f1..bc6517887ccf3366359a13838193058ae3c76ad4 100644 (file)
@@ -10,9 +10,7 @@ package org.opendaylight.bgpcep.bgp.topology.provider.spi;
 
 import com.google.common.annotations.Beta;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
 import org.opendaylight.yangtools.concepts.AbstractRegistration;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 @Beta
 public interface BgpTopologyDeployer {
index a1c79d07af6026a1e010519996db7b93e105e554..2bd3a26a6dd6526204aeeb63ebce8e2142080bb4 100644 (file)
@@ -310,7 +310,7 @@ public final class TestUtil {
         return attribBuilder.build();
     }
 
-    private static final List<Communities> createCommunities() {
+    private static List<Communities> createCommunities() {
         final List<Communities> communities = Lists.newArrayList();
         final CommunitiesBuilder commBuilder = new CommunitiesBuilder()
             .setAsNumber(new AsNumber(65535L))
index 9eae09028c0c7ca0e667d20ce40ce3bc395e2559..84815407eb37c2a9c8252a4035a8fe05ab579b71 100644 (file)
@@ -23,7 +23,7 @@ public enum TerminationReason {
         }
     }
 
-    private TerminationReason(final short value) {
+    TerminationReason(final short value) {
         this.value = value;
     }
 
index 2edddd63be4569c7757977f78ee794e4390aa988..6eb4283727da12a48491df7e28652608768af1bd 100644 (file)
@@ -140,7 +140,7 @@ public abstract class AbstractMessageParser implements MessageParser, MessageSer
         }
     }
 
-    protected static final List<VendorInformationObject> addVendorInformationObjects(final List<Object> objects) {
+    protected static List<VendorInformationObject> addVendorInformationObjects(final List<Object> objects) {
         final List<VendorInformationObject> vendorInfo = new ArrayList<>();
         while (!objects.isEmpty() && objects.get(0) instanceof VendorInformationObject) {
             final VendorInformationObject viObject = (VendorInformationObject) objects.get(0);
index d32aa7163c47bd32250085174d93b2349276ac2b..76e7db95469bed367ae45b3e21e011a7a8493b81 100644 (file)
@@ -362,7 +362,7 @@ public enum PCEPErrors {
         return VALUE_MAP.get(new PCEPErrorIdentifier(errorType, errorValue));
     }
 
-    private PCEPErrors(final int type, final int value) {
+    PCEPErrors(final int type, final int value) {
         this.errorId = new PCEPErrorIdentifier((short) type, (short) value);
     }