Removed some sonar warnings from bgp. 35/3435/2
authorDana Kutenicsova <dkutenic@cisco.com>
Wed, 4 Dec 2013 12:10:17 +0000 (13:10 +0100)
committerDana Kutenicsova <dkutenic@cisco.com>
Wed, 4 Dec 2013 13:05:11 +0000 (14:05 +0100)
Change-Id: Iad2d61193e1159ac361ff168b5842e59f5df61fd
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
21 files changed:
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAdjRIBsIn.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/LinkstateAttributeParser.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/LinkstateNlriParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/BGPOpenMessageParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/BGPUpdateMessageParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/open/CapabilityParameterParser.java
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/message/update/CommunitiesParser.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/AbstractBGPExtensionProviderActivator.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/AbstractFamilyRegistry.java
bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/pojo/AbstractMessageRegistry.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPByteToMessageDecoder.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPMessageToByteEncoder.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionNegotiator.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSynchronization.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/spi/BGPSessionProposal.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractAdjRIBsIn.java
bgp/rib-spi/src/main/java/org/opendaylight/protocol/bgp/rib/spi/AbstractRIBExtensionProviderActivator.java
bgp/testtool/src/main/java/org/opendaylight/protocol/bgp/testtool/Main.java
bgp/testtool/src/main/java/org/opendaylight/protocol/bgp/testtool/TestingListener.java

index af8ab681dc17a3759a6787d97086a23d7cdd82de..66308125a93cc6b755b92d67d92c7c38d6cb520e 100644 (file)
@@ -51,16 +51,16 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import com.google.common.base.Preconditions;
 
 final class LinkstateAdjRIBsIn extends AbstractAdjRIBsIn<CLinkstateDestination, LinkstateRoute> {
-       private static abstract class LinkstateRIBEntryData<LSATTR extends LinkStateAttribute> extends
-       RIBEntryData<CLinkstateDestination, LinkstateRoute> {
-               private final LSATTR lsattr;
+       private abstract static class LinkstateRIBEntryData<A extends LinkStateAttribute> extends
+                       RIBEntryData<CLinkstateDestination, LinkstateRoute> {
+               private final A lsattr;
 
-               protected LinkstateRIBEntryData(final PathAttributes attributes, final LSATTR lsattr) {
+               protected LinkstateRIBEntryData(final PathAttributes attributes, final A lsattr) {
                        super(attributes);
                        this.lsattr = Preconditions.checkNotNull(lsattr);
                }
 
-               protected abstract AttributeType createAttributes(LSATTR lsattr);
+               protected abstract AttributeType createAttributes(A lsattr);
 
                protected abstract ObjectType createObject(CLinkstateDestination key);
 
index 8d6130e78197f666c3535b5569f47e4cc02ca8ac..0a37d1ee810588403fef9e32e6510359f76cf178 100644 (file)
@@ -68,7 +68,7 @@ public class LinkstateAttributeParser implements AttributeParser {
        // TODO: replace with actual values by IANA
        public static final int TYPE = 99;
 
-       private static final Logger logger = LoggerFactory.getLogger(LinkstateAttributeParser.class);
+       private static final Logger LOG = LoggerFactory.getLogger(LinkstateAttributeParser.class);
 
        private static final int TYPE_LENGTH = 2;
 
@@ -90,7 +90,7 @@ public class LinkstateAttributeParser implements AttributeParser {
        private static boolean verifyLink(final Set<Integer> keys) {
                for (final Integer i : keys) {
                        if (!LINK_TLVS.contains(i)) {
-                               logger.warn("Invalid link attribute {}", i);
+                               LOG.warn("Invalid link attribute {}", i);
                                return false;
                        }
                }
@@ -100,7 +100,7 @@ public class LinkstateAttributeParser implements AttributeParser {
        private static boolean verifyNode(final Set<Integer> keys) {
                for (final Integer i : keys) {
                        if (!NODE_TLVS.contains(i)) {
-                               logger.warn("Invalid node attribute {}", i);
+                               LOG.warn("Invalid node attribute {}", i);
                                return false;
                        }
                }
@@ -110,7 +110,7 @@ public class LinkstateAttributeParser implements AttributeParser {
        private static boolean verifyPrefix(final Set<Integer> keys) {
                for (final Integer i : keys) {
                        if (!PREFIX_TLVS.contains(i)) {
-                               logger.warn("Invalid prefix attribute {}", i);
+                               LOG.warn("Invalid prefix attribute {}", i);
                                return false;
                        }
                }
@@ -153,7 +153,7 @@ public class LinkstateAttributeParser implements AttributeParser {
 
                final LinkAttributesBuilder builder = new LinkAttributesBuilder();
                for (final Entry<Integer, ByteList> entry : attributes.entrySet()) {
-                       logger.trace("Link attribute TLV {}", entry.getKey());
+                       LOG.trace("Link attribute TLV {}", entry.getKey());
 
                        for (final byte[] value : entry.getValue().getBytes()) {
 
@@ -161,34 +161,34 @@ public class LinkstateAttributeParser implements AttributeParser {
                                case 1028:
                                        final Ipv4RouterIdentifier lipv4 = new Ipv4RouterIdentifier(Ipv4Util.addressForBytes(value));
                                        builder.setLocalIpv4RouterId(lipv4);
-                                       logger.debug("Parsed IPv4 Router-ID of local node: {}", lipv4);
+                                       LOG.debug("Parsed IPv4 Router-ID of local node: {}", lipv4);
                                        break;
                                case 1029:
                                        final Ipv6RouterIdentifier lipv6 = new Ipv6RouterIdentifier(Ipv6Util.addressForBytes(value));
                                        builder.setLocalIpv6RouterId(lipv6);
-                                       logger.debug("Parsed IPv6 Router-ID of local node: {}", lipv6);
+                                       LOG.debug("Parsed IPv6 Router-ID of local node: {}", lipv6);
                                        break;
                                case 1030:
                                        final Ipv4RouterIdentifier ripv4 = new Ipv4RouterIdentifier(Ipv4Util.addressForBytes(value));
                                        builder.setRemoteIpv4RouterId(ripv4);
-                                       logger.debug("Parsed IPv4 Router-ID of remote node: {}", ripv4);
+                                       LOG.debug("Parsed IPv4 Router-ID of remote node: {}", ripv4);
                                        break;
                                case 1031:
                                        final Ipv6RouterIdentifier ripv6 = new Ipv6RouterIdentifier(Ipv6Util.addressForBytes(value));
                                        builder.setRemoteIpv6RouterId(ripv6);
-                                       logger.debug("Parsed IPv6 Router-ID of remote node: {}", ripv6);
+                                       LOG.debug("Parsed IPv6 Router-ID of remote node: {}", ripv6);
                                        break;
                                case 1088:
                                        builder.setAdminGroup(new AdministrativeGroup(ByteArray.bytesToLong(value)));
-                                       logger.debug("Parsed Administrative Group {}", builder.getAdminGroup());
+                                       LOG.debug("Parsed Administrative Group {}", builder.getAdminGroup());
                                        break;
                                case 1089:
                                        builder.setMaxLinkBandwidth(new Bandwidth(value));
-                                       logger.debug("Parsed Max Bandwidth {}", builder.getMaxLinkBandwidth());
+                                       LOG.debug("Parsed Max Bandwidth {}", builder.getMaxLinkBandwidth());
                                        break;
                                case 1090:
                                        builder.setMaxReservableBandwidth(new Bandwidth(value));
-                                       logger.debug("Parsed Max Reservable Bandwidth {}", builder.getMaxReservableBandwidth());
+                                       LOG.debug("Parsed Max Reservable Bandwidth {}", builder.getMaxReservableBandwidth());
                                        break;
                                case 1091:
                                        int index = 0;
@@ -199,11 +199,11 @@ public class LinkstateAttributeParser implements AttributeParser {
                                                index += 4;
                                        }
                                        builder.setUnreservedBandwidth(unreservedBandwidth);
-                                       logger.debug("Parsed Unreserved Bandwidth {}", builder.getUnreservedBandwidth());
+                                       LOG.debug("Parsed Unreserved Bandwidth {}", builder.getUnreservedBandwidth());
                                        break;
                                case 1092:
                                        builder.setTeMetric(new TeMetric(ByteArray.bytesToLong(value)));
-                                       logger.debug("Parsed Metric {}", builder.getTeMetric());
+                                       LOG.debug("Parsed Metric {}", builder.getTeMetric());
                                        break;
                                case 1093:
                                        final LinkProtectionType lpt = LinkProtectionType.forValue(UnsignedBytes.toInt(value[0]));
@@ -211,16 +211,16 @@ public class LinkstateAttributeParser implements AttributeParser {
                                                throw new BGPParsingException("Link Protection Type not recognized: " + UnsignedBytes.toInt(value[0]));
                                        }
                                        builder.setLinkProtection(lpt);
-                                       logger.debug("Parsed Link Protection Type {}", lpt);
+                                       LOG.debug("Parsed Link Protection Type {}", lpt);
                                        break;
                                case 1094:
                                        final boolean[] bits = ByteArray.parseBits(value[0]);
                                        builder.setMplsProtocol(new MplsProtocolMask(bits[0], bits[1]));
-                                       logger.debug("Parsed MPLS Protocols: {}", builder.getMplsProtocol());
+                                       LOG.debug("Parsed MPLS Protocols: {}", builder.getMplsProtocol());
                                        break;
                                case 1095:
                                        builder.setMetric(new Metric(ByteArray.bytesToLong(value)));
-                                       logger.debug("Parsed Metric {}", builder.getMetric());
+                                       LOG.debug("Parsed Metric {}", builder.getMetric());
                                        break;
                                case 1096:
                                        int i = 0;
@@ -230,23 +230,23 @@ public class LinkstateAttributeParser implements AttributeParser {
                                                i += 4;
                                        }
                                        builder.setSharedRiskLinkGroups(sharedRiskLinkGroups);
-                                       logger.debug("Parsed Shared Risk Link Groups {}", Arrays.toString(sharedRiskLinkGroups.toArray()));
+                                       LOG.debug("Parsed Shared Risk Link Groups {}", Arrays.toString(sharedRiskLinkGroups.toArray()));
                                        break;
                                case 1097:
                                        final byte[] opaque = value;
-                                       logger.debug("Parsed Opaque value : {}", Arrays.toString(opaque));
+                                       LOG.debug("Parsed Opaque value : {}", Arrays.toString(opaque));
                                        break;
                                case 1098:
                                        final String name = new String(value, Charsets.US_ASCII);
                                        builder.setLinkName(name);
-                                       logger.debug("Parsed Link Name : {}", name);
+                                       LOG.debug("Parsed Link Name : {}", name);
                                        break;
                                default:
                                        throw new BGPParsingException("Link Attribute not recognized, type: " + entry.getKey());
                                }
                        }
                }
-               logger.trace("Finished parsing Link Attributes.");
+               LOG.trace("Finished parsing Link Attributes.");
                return new LinkAttributesCaseBuilder().setLinkAttributes(builder.build()).build();
        }
 
@@ -262,7 +262,7 @@ public class LinkstateAttributeParser implements AttributeParser {
                final List<IsisAreaIdentifier> areaMembership = Lists.newArrayList();
                final NodeAttributesBuilder builder = new NodeAttributesBuilder();
                for (final Entry<Integer, ByteList> entry : attributes.entrySet()) {
-                       logger.trace("Node attribute TLV {}", entry.getKey());
+                       LOG.trace("Node attribute TLV {}", entry.getKey());
                        for (final byte[] value : entry.getValue().getBytes()) {
                                switch (entry.getKey()) {
                                case 263:
@@ -270,38 +270,38 @@ public class LinkstateAttributeParser implements AttributeParser {
                                        while (i != value.length) {
                                                final TopologyIdentifier topId = new TopologyIdentifier(ByteArray.bytesToInt(ByteArray.subByte(value, i, 2)) & 0x3fff);
                                                topologyMembership.add(topId);
-                                               logger.debug("Parsed Topology Identifier: {}", topId);
+                                               LOG.debug("Parsed Topology Identifier: {}", topId);
                                                i += 2;
                                        }
                                        break;
                                case 1024:
                                        final boolean[] flags = ByteArray.parseBits(value[0]);
                                        builder.setNodeFlags(new NodeFlagBits(flags[0], flags[1], flags[2], flags[3]));
-                                       logger.debug("Parsed External bit {}, area border router {}.", flags[2], flags[3]);
+                                       LOG.debug("Parsed External bit {}, area border router {}.", flags[2], flags[3]);
                                        break;
                                case 1025:
-                                       logger.debug("Ignoring opaque value: {}.", Arrays.toString(value));
+                                       LOG.debug("Ignoring opaque value: {}.", Arrays.toString(value));
                                        break;
                                case 1026:
                                        builder.setDynamicHostname(new String(value, Charsets.US_ASCII));
-                                       logger.debug("Parsed Node Name {}", builder.getDynamicHostname());
+                                       LOG.debug("Parsed Node Name {}", builder.getDynamicHostname());
                                        break;
                                case 1027:
                                        final byte[] dest = new byte[20];
                                        System.arraycopy(value, 0, dest, 20 - value.length, value.length);
                                        final IsisAreaIdentifier ai = new IsisAreaIdentifier(dest);
                                        areaMembership.add(ai);
-                                       logger.debug("Parsed AreaIdentifier {}", ai);
+                                       LOG.debug("Parsed AreaIdentifier {}", ai);
                                        break;
                                case 1028:
                                        final Ipv4RouterIdentifier ip4 = new Ipv4RouterIdentifier(Ipv4Util.addressForBytes(value));
                                        builder.setIpv4RouterId(ip4);
-                                       logger.debug("Parsed IPv4 Router Identifier {}", ip4);
+                                       LOG.debug("Parsed IPv4 Router Identifier {}", ip4);
                                        break;
                                case 1029:
                                        final Ipv6RouterIdentifier ip6 = new Ipv6RouterIdentifier(Ipv6Util.addressForBytes(value));
                                        builder.setIpv6RouterId(ip6);
-                                       logger.debug("Parsed IPv6 Router Identifier {}", ip6);
+                                       LOG.debug("Parsed IPv6 Router Identifier {}", ip6);
                                        break;
                                default:
                                        throw new BGPParsingException("Node Attribute not recognized, type: " + entry.getKey());
@@ -310,7 +310,7 @@ public class LinkstateAttributeParser implements AttributeParser {
                }
                builder.setTopologyIdentifier(topologyMembership);
                builder.setIsisAreaId(areaMembership);
-               logger.trace("Finished parsing Node Attributes.");
+               LOG.trace("Finished parsing Node Attributes.");
                return new NodeAttributesCaseBuilder().setNodeAttributes(builder.build()).build();
        }
 
@@ -326,21 +326,21 @@ public class LinkstateAttributeParser implements AttributeParser {
                final List<RouteTag> routeTags = Lists.newArrayList();
                final List<ExtendedRouteTag> exRouteTags = Lists.newArrayList();
                for (final Entry<Integer, ByteList> entry : attributes.entrySet()) {
-                       logger.debug("Prefix attribute TLV {}", entry.getKey());
+                       LOG.debug("Prefix attribute TLV {}", entry.getKey());
                        for (final byte[] value : entry.getValue().getBytes()) {
                                switch (entry.getKey()) {
                                case 1152:
                                        final boolean[] flags = ByteArray.parseBits(value[0]);
                                        final boolean upDownBit = flags[2];
                                        builder.setIgpBits(new IgpBitsBuilder().setUpDown(new UpDown(upDownBit)).build());
-                                       logger.trace("Parsed IGP flag (up/down bit) : {}", upDownBit);
+                                       LOG.trace("Parsed IGP flag (up/down bit) : {}", upDownBit);
                                        break;
                                case 1153:
                                        int offset = 0;
                                        while (offset != value.length) {
                                                final RouteTag routeTag = new RouteTag(ByteArray.subByte(value, offset, 4));
                                                routeTags.add(routeTag);
-                                               logger.trace("Parsed Route Tag: {}", routeTag);
+                                               LOG.trace("Parsed Route Tag: {}", routeTag);
                                                offset += 4;
                                        }
                                        break;
@@ -349,14 +349,14 @@ public class LinkstateAttributeParser implements AttributeParser {
                                        while (offset != value.length) {
                                                final ExtendedRouteTag exRouteTag = new ExtendedRouteTag(value);
                                                exRouteTags.add(exRouteTag);
-                                               logger.trace("Parsed Extended Route Tag: {}", exRouteTag);
+                                               LOG.trace("Parsed Extended Route Tag: {}", exRouteTag);
                                                offset += 4;
                                        }
                                        break;
                                case 1155:
                                        final IgpMetric metric = new IgpMetric(ByteArray.bytesToLong(value));
                                        builder.setPrefixMetric(metric);
-                                       logger.trace("Parsed Metric: {}", metric);
+                                       LOG.trace("Parsed Metric: {}", metric);
                                        break;
                                case 1156:
                                        IpAddress fwdAddress = null;
@@ -368,20 +368,20 @@ public class LinkstateAttributeParser implements AttributeParser {
                                                fwdAddress = new IpAddress(Ipv6Util.addressForBytes(value));
                                                break;
                                        default:
-                                               logger.debug("Ignoring unsupported forwarding address length {}", value.length);
+                                               LOG.debug("Ignoring unsupported forwarding address length {}", value.length);
                                        }
-                                       logger.trace("Parsed FWD Address: {}", fwdAddress);
+                                       LOG.trace("Parsed FWD Address: {}", fwdAddress);
                                        break;
                                case 1157:
                                        final byte[] opaque = value;
-                                       logger.trace("Parsed Opaque value: {}", Arrays.toString(opaque));
+                                       LOG.trace("Parsed Opaque value: {}", Arrays.toString(opaque));
                                        break;
                                default:
                                        throw new BGPParsingException("Prefix Attribute not recognized, type: " + entry.getKey());
                                }
                        }
                }
-               logger.debug("Finished parsing Prefix Attributes.");
+               LOG.debug("Finished parsing Prefix Attributes.");
                builder.setRouteTags(routeTags);
                builder.setExtendedTags(exRouteTags);
                return new PrefixAttributesCaseBuilder().setPrefixAttributes(builder.build()).build();
index 8093a0773fa78359d06e593b8e691189c749f4c2..1cc4d6643b6e8b7aade30b34cc167da778bb7f1e 100644 (file)
@@ -359,7 +359,7 @@ public final class LinkstateNlriParser implements NlriParser {
        }
 
        @Override
-       public final void parseNlri(final byte[] nlri, final MpUnreachNlriBuilder builder) throws BGPParsingException {
+       public void parseNlri(final byte[] nlri, final MpUnreachNlriBuilder builder) throws BGPParsingException {
                if (nlri.length == 0) {
                        return;
                }
index 8eaccd37ee9b678545ef83c4d34c6065e6c099b2..5e1f23f408ce2474d263b5b602a4f4f586274612 100644 (file)
@@ -42,7 +42,7 @@ import com.google.common.primitives.UnsignedBytes;
 public final class BGPOpenMessageParser implements MessageParser, MessageSerializer {
        public static final int TYPE = 1;
 
-       private static final Logger logger = LoggerFactory.getLogger(BGPOpenMessageParser.class);
+       private static final Logger LOG = LoggerFactory.getLogger(BGPOpenMessageParser.class);
 
        private static final int VERSION_SIZE = 1;
        private static final int AS_SIZE = 2;
@@ -73,7 +73,7 @@ public final class BGPOpenMessageParser implements MessageParser, MessageSeriali
                if (msg == null) {
                        throw new IllegalArgumentException("BGPOpen message cannot be null");
                }
-               logger.trace("Started serializing open message: {}", msg);
+               LOG.trace("Started serializing open message: {}", msg);
                final Open open = (Open) msg;
 
                final Map<byte[], Integer> optParams = Maps.newHashMap();
@@ -120,7 +120,7 @@ public final class BGPOpenMessageParser implements MessageParser, MessageSeriali
                        }
                }
                final byte[] ret = MessageUtil.formatMessage(TYPE, msgBody);
-               logger.trace("Open message serialized to: {}", Arrays.toString(ret));
+               LOG.trace("Open message serialized to: {}", Arrays.toString(ret));
                return ret;
        }
 
@@ -136,7 +136,7 @@ public final class BGPOpenMessageParser implements MessageParser, MessageSeriali
                if (body == null) {
                        throw new IllegalArgumentException("Byte array cannot be null.");
                }
-               logger.trace("Started parsing of open message: {}", Arrays.toString(body));
+               LOG.trace("Started parsing of open message: {}", Arrays.toString(body));
 
                if (body.length < MIN_MSG_LENGTH) {
                        throw BGPDocumentedException.badMessageLength("Open message too small.", messageLength);
@@ -167,7 +167,7 @@ public final class BGPOpenMessageParser implements MessageParser, MessageSeriali
                if (optLength > 0) {
                        fillParams(ByteArray.subByte(body, MIN_MSG_LENGTH, optLength), optParams);
                }
-               logger.trace("Open message was parsed: AS = {}, holdTimer = {}, bgpId = {}, optParams = {}", as, holdTime, bgpId, optParams);
+               LOG.trace("Open message was parsed: AS = {}, holdTimer = {}, bgpId = {}, optParams = {}", as, holdTime, bgpId, optParams);
                return new OpenBuilder().setMyAsNumber(as.getValue().intValue()).setHoldTimer((int) holdTime).setBgpIdentifier(bgpId).setBgpParameters(
                                optParams).build();
        }
@@ -176,7 +176,7 @@ public final class BGPOpenMessageParser implements MessageParser, MessageSeriali
                if (bytes == null || bytes.length == 0) {
                        throw new IllegalArgumentException("Byte array cannot be null or empty.");
                }
-               logger.trace("Started parsing of BGP parameter: {}", Arrays.toString(bytes));
+               LOG.trace("Started parsing of BGP parameter: {}", Arrays.toString(bytes));
                int byteOffset = 0;
                while (byteOffset < bytes.length) {
                        if (byteOffset + 2 >= bytes.length) {
@@ -196,9 +196,9 @@ public final class BGPOpenMessageParser implements MessageParser, MessageSeriali
                        if (param != null) {
                                params.add(param);
                        } else {
-                               logger.debug("Ignoring BGP Parameter type: {}", paramType);
+                               LOG.debug("Ignoring BGP Parameter type: {}", paramType);
                        }
                }
-               logger.trace("Parsed BGP parameters: {}", Arrays.toString(params.toArray()));
+               LOG.trace("Parsed BGP parameters: {}", Arrays.toString(params.toArray()));
        }
 }
index 8011633fd33de1f94b0f5fb7946f055f5ee169b0..01ae5f0cc5556e37108b201778d42ae459d21c68 100644 (file)
@@ -37,7 +37,7 @@ import com.google.common.base.Preconditions;
 public class BGPUpdateMessageParser implements MessageParser {
        public static final int TYPE = 2;
 
-       private static Logger logger = LoggerFactory.getLogger(BGPUpdateMessageParser.class);
+       private static Logger LOG = LoggerFactory.getLogger(BGPUpdateMessageParser.class);
 
        /**
         * Size of the withdrawn_routes_length field, in bytes.
@@ -63,7 +63,7 @@ public class BGPUpdateMessageParser implements MessageParser {
                if (body == null || body.length == 0) {
                        throw new IllegalArgumentException("Byte array cannot be null or empty.");
                }
-               logger.trace("Started parsing of update message: {}", Arrays.toString(body));
+               LOG.trace("Started parsing of update message: {}", Arrays.toString(body));
 
                int byteOffset = 0;
 
@@ -99,7 +99,7 @@ public class BGPUpdateMessageParser implements MessageParser {
                                throw e;
                        } catch (final Exception e) {
                                // Catch everything else and turn it into a BGPDocumentedException
-                               logger.warn("Could not parse BGP attributes", e);
+                               LOG.warn("Could not parse BGP attributes", e);
                                throw new BGPDocumentedException("Could not parse BGP attributes.", BGPError.MALFORMED_ATTR_LIST, e);
                        }
                }
@@ -108,7 +108,7 @@ public class BGPUpdateMessageParser implements MessageParser {
                if (nlri != null && !nlri.isEmpty()) {
                        eventBuilder.setNlri(new NlriBuilder().setNlri(nlri).build());
                }
-               logger.trace("Update message was parsed.");
+               LOG.trace("Update message was parsed.");
                return eventBuilder.build();
        }
 }
index d9c6163d6fd2ca68096219e896d8165f847c1413..edc12e4f7e718b7a34a48dfe460df1681e5876a3 100644 (file)
@@ -31,7 +31,7 @@ import com.google.common.primitives.UnsignedBytes;
 public final class CapabilityParameterParser implements ParameterParser, ParameterSerializer {
        public static final int TYPE = 2;
 
-       private static final Logger logger = LoggerFactory.getLogger(CapabilityParameterParser.class);
+       private static final Logger LOG = LoggerFactory.getLogger(CapabilityParameterParser.class);
        private final CapabilityRegistry reg;
 
        public CapabilityParameterParser(final CapabilityRegistry reg) {
@@ -43,7 +43,7 @@ public final class CapabilityParameterParser implements ParameterParser, Paramet
                if (bytes == null || bytes.length == 0) {
                        throw new IllegalArgumentException("Byte array cannot be null or empty.");
                }
-               logger.trace("Started parsing of BGP Capability: {}", Arrays.toString(bytes));
+               LOG.trace("Started parsing of BGP Capability: {}", Arrays.toString(bytes));
                int byteOffset = 0;
                final int capCode = UnsignedBytes.toInt(bytes[byteOffset++]);
                final int capLength = UnsignedBytes.toInt(bytes[byteOffset++]);
@@ -51,7 +51,7 @@ public final class CapabilityParameterParser implements ParameterParser, Paramet
 
                final CParameters ret = reg.parseCapability(capCode, paramBody);
                if (ret == null) {
-                       logger.debug("Ignoring unsupported capability {}", capCode);
+                       LOG.debug("Ignoring unsupported capability {}", capCode);
                        return null;
                }
 
@@ -62,14 +62,14 @@ public final class CapabilityParameterParser implements ParameterParser, Paramet
        public byte[] serializeParameter(final BgpParameters parameter) {
                final CParameters cap = parameter.getCParameters();
 
-               logger.trace("Started serializing BGP Capability: {}", cap);
+               LOG.trace("Started serializing BGP Capability: {}", cap);
 
                byte[] bytes = reg.serializeCapability(cap);
                if (bytes == null) {
                        throw new IllegalArgumentException("Unhandled capability class" + cap.getImplementedInterface());
                }
 
-               logger.trace("BGP capability serialized to: {}", Arrays.toString(bytes));
+               LOG.trace("BGP capability serialized to: {}", Arrays.toString(bytes));
 
                return ParameterUtil.formatParameter(TYPE, bytes);
        }
index 075318c98e319790b12ac172c05b418616d82f21..f777d52f601f6e0bc7b99f9e530b99dc193c022c 100644 (file)
@@ -65,6 +65,12 @@ public final class CommunitiesParser {
 
        protected static final short ROUTE_ORIGIN_SUBTYPE = 3;
 
+       private static final byte[] NO_EXPORT = new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x01 };
+
+       private static final byte[] NO_ADVERTISE = new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x02 };
+
+       private static final byte[] NO_EXPORT_SUBCONFED = new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x03 };
+
        private CommunitiesParser() {
 
        }
@@ -80,11 +86,11 @@ public final class CommunitiesParser {
                if (bytes.length != COMMUNITY_LENGTH) {
                        throw new BGPDocumentedException("Community with wrong length: " + bytes.length, BGPError.OPT_ATTR_ERROR);
                }
-               if (Arrays.equals(bytes, new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x01 })) {
+               if (Arrays.equals(bytes, NO_EXPORT)) {
                        return CommunityUtil.NO_EXPORT;
-               } else if (Arrays.equals(bytes, new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x02 })) {
+               } else if (Arrays.equals(bytes, NO_ADVERTISE)) {
                        return CommunityUtil.NO_ADVERTISE;
-               } else if (Arrays.equals(bytes, new byte[] { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x03 })) {
+               } else if (Arrays.equals(bytes, NO_EXPORT_SUBCONFED)) {
                        return CommunityUtil.NO_EXPORT_SUBCONFED;
                }
                return CommunityUtil.create((ByteArray.bytesToLong(Arrays.copyOfRange(bytes, 0, AS_NUMBER_LENGTH))),
index 45277599011ff0c7612da64e95f75d13747a9c75..361beee806a833ec5027e1a99aa57d86e5f4d0a1 100644 (file)
@@ -28,14 +28,14 @@ public abstract class AbstractBGPExtensionProviderActivator implements BGPExtens
        protected abstract List<AutoCloseable> startImpl(BGPExtensionProviderContext context);
 
        @Override
-       public synchronized final void start(final BGPExtensionProviderContext context) {
+       public final synchronized void start(final BGPExtensionProviderContext context) {
                Preconditions.checkState(this.registrations == null);
 
                this.registrations = Preconditions.checkNotNull(startImpl(context));
        }
 
        @Override
-       public synchronized final void stop() {
+       public final synchronized void stop() {
                Preconditions.checkState(this.registrations != null);
 
                for (final AutoCloseable r : this.registrations) {
index 871a20a8dca7ff441053cc6248ff518bd3101122..80c1d3740d7abdc86f524ae4e8aa368bad495d6a 100644 (file)
@@ -14,17 +14,17 @@ import org.opendaylight.protocol.concepts.AbstractRegistration;
 
 import com.google.common.base.Preconditions;
 
-abstract class AbstractFamilyRegistry<CLASS, NUMBER> {
-       private final Map<Class<? extends CLASS>, NUMBER> classToNumber = new ConcurrentHashMap<>();
-       private final Map<NUMBER, Class<? extends CLASS>> numberToClass = new ConcurrentHashMap<>();
+abstract class AbstractFamilyRegistry<C, N> {
+       private final Map<Class<? extends C>, N> classToNumber = new ConcurrentHashMap<>();
+       private final Map<N, Class<? extends C>> numberToClass = new ConcurrentHashMap<>();
 
-       protected synchronized AutoCloseable registerFamily(final Class<? extends CLASS> clazz, final NUMBER number) {
+       protected synchronized AutoCloseable registerFamily(final Class<? extends C> clazz, final N number) {
                Preconditions.checkNotNull(clazz);
 
                final Class<?> c = numberToClass.get(number);
                Preconditions.checkState(c == null, "Number " + number + " already registered to " + c);
 
-               final NUMBER n = classToNumber.get(clazz);
+               final N n = classToNumber.get(clazz);
                Preconditions.checkState(n == null, "Class " + clazz + " already registered to " + n);
 
                numberToClass.put(number, clazz);
@@ -43,11 +43,11 @@ abstract class AbstractFamilyRegistry<CLASS, NUMBER> {
                };
        }
 
-       protected Class<? extends CLASS> classForFamily(final NUMBER number) {
+       protected Class<? extends C> classForFamily(final N number) {
                return numberToClass.get(number);
        }
 
-       protected NUMBER numberForClass(final Class<? extends CLASS> clazz) {
+       protected N numberForClass(final Class<? extends C> clazz) {
                return classToNumber.get(clazz);
        }
 }
index 213cd24f7847a8e81dfb7e177027336c4f4c02c8..d0bdebadb585ea5f57cbef4314ba8f2c29d92a08 100644 (file)
@@ -22,14 +22,14 @@ import org.slf4j.LoggerFactory;
 import com.google.common.primitives.UnsignedBytes;
 
 abstract class AbstractMessageRegistry implements MessageRegistry {
-       private final static Logger logger = LoggerFactory.getLogger(AbstractMessageRegistry.class);
+       private static final Logger logger = LoggerFactory.getLogger(AbstractMessageRegistry.class);
+
+       private static final byte[] MARKER;
 
        protected abstract Notification parseBody(final int type, final byte[] body, final int messageLength) throws BGPDocumentedException;
 
        protected abstract byte[] serializeMessageImpl(final Notification message);
 
-       private final static byte[] MARKER;
-
        static {
                MARKER = new byte[MessageUtil.MARKER_LENGTH];
                Arrays.fill(MARKER, (byte) 0xff);
index c5d9f4c7be88d68d1706db8316d9b8a5be23e11f..5cb2c2bfd7aac575e3f74dbf1c4dd1a43949d514 100644 (file)
@@ -26,7 +26,7 @@ import com.google.common.base.Preconditions;
  *
  */
 final class BGPByteToMessageDecoder extends ByteToMessageDecoder {
-       private final static Logger LOG = LoggerFactory.getLogger(BGPByteToMessageDecoder.class);
+       private static final Logger LOG = LoggerFactory.getLogger(BGPByteToMessageDecoder.class);
        private final MessageRegistry registry;
 
        public BGPByteToMessageDecoder(final MessageRegistry registry) {
index 7960ed916faffe63eee24720c503ef65b7c5ab14..4cd331ec2111b7f919de270b04436369f33c066a 100644 (file)
@@ -24,7 +24,7 @@ import com.google.common.base.Preconditions;
  */
 @Sharable
 final class BGPMessageToByteEncoder extends MessageToByteEncoder<Notification> {
-       private final static Logger LOG = LoggerFactory.getLogger(BGPMessageToByteEncoder.class);
+       private static final Logger LOG = LoggerFactory.getLogger(BGPMessageToByteEncoder.class);
        private final MessageRegistry registry;
 
        BGPMessageToByteEncoder(final MessageRegistry registry) {
index 09bb8685d896865d5bf7eedc0a823d011740154c..b91ad204690f3b842973f17d0901b6217cabeb93 100644 (file)
@@ -30,7 +30,7 @@ import com.google.common.collect.Sets;
  * RIB actions.
  */
 public final class BGPPeer implements BGPSessionListener, Peer {
-       private static final Logger logger = LoggerFactory.getLogger(BGPPeer.class);
+       private static final Logger LOG = LoggerFactory.getLogger(BGPPeer.class);
        private final Set<TablesKey> tables = Sets.newHashSet();
        private final String name;
        private final RIBImpl rib;
@@ -45,13 +45,13 @@ public final class BGPPeer implements BGPSessionListener, Peer {
                if (message instanceof Update) {
                        this.rib.updateTables(this, (Update) message);
                } else {
-                       logger.info("Ignoring unhandled message class " + message.getClass());
+                       LOG.info("Ignoring unhandled message class " + message.getClass());
                }
        }
 
        @Override
        public void onSessionUp(final BGPSession session) {
-               logger.info("Session with peer {} went up with tables: {}", this.name, session.getAdvertisedTableTypes());
+               LOG.info("Session with peer {} went up with tables: {}", this.name, session.getAdvertisedTableTypes());
 
                for (final BgpTableType t : session.getAdvertisedTableTypes()) {
                        this.tables.add(new TablesKey(t.getAfi(), t.getSafi()));
@@ -69,18 +69,18 @@ public final class BGPPeer implements BGPSessionListener, Peer {
 
        @Override
        public void onSessionDown(final BGPSession session, final Exception e) {
-               logger.info("Session with peer {} went down", this.name, e);
+               LOG.info("Session with peer {} went down", this.name, e);
                cleanup();
        }
 
        @Override
        public void onSessionTerminated(final BGPSession session, final BGPTerminationReason cause) {
-               logger.info("Session with peer {} terminated: {}", this.name, cause);
+               LOG.info("Session with peer {} terminated: {}", this.name, cause);
                cleanup();
        }
 
        @Override
-       public final String toString() {
+       public String toString() {
                return addToStringAttributes(Objects.toStringHelper(this)).toString();
        }
 
index 423ccc6cfd350505ab5e9f10772e8361168ab62a..3a68dcecc06ea4d70655a006e6c86dddc5ba9fec 100644 (file)
@@ -48,14 +48,14 @@ import com.google.common.collect.Sets;
 @VisibleForTesting
 public class BGPSessionImpl extends AbstractProtocolSession<Notification> implements BGPSession {
 
-       private static final Logger logger = LoggerFactory.getLogger(BGPSessionImpl.class);
+       private static final Logger LOG = LoggerFactory.getLogger(BGPSessionImpl.class);
 
        /*
         * 240
         */
        private static final int DEFAULT_HOLD_TIMER_VALUE = 15;
 
-       private static final Notification keepalive = new KeepaliveBuilder().build();
+       private static final Notification KEEP_ALIVE = new KeepaliveBuilder().build();
 
        private static int holdTimerValue = DEFAULT_HOLD_TIMER_VALUE;
 
@@ -153,7 +153,7 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
 
        @Override
        public synchronized void close() {
-               logger.debug("Closing session: {}", this);
+               LOG.debug("Closing session: {}", this);
                if (this.state != State.Idle) {
                        this.sendMessage(new NotifyBuilder().setErrorCode(BGPError.CEASE.getCode()).build());
                        this.channel.close();
@@ -176,14 +176,14 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
                        this.terminate(BGPError.FSM_ERROR);
                } else if (msg instanceof Notify) {
                        // Notifications are handled internally
-                       logger.info("Session closed because Notification message received: {} / {}", ((Notify) msg).getErrorCode(),
+                       LOG.info("Session closed because Notification message received: {} / {}", ((Notify) msg).getErrorCode(),
                                        ((Notify) msg).getErrorSubcode());
                        this.closeWithoutMessage();
                        this.listener.onSessionTerminated(this,
                                        new BGPTerminationReason(BGPError.forValue(((Notify) msg).getErrorCode(), ((Notify) msg).getErrorSubcode())));
                } else if (msg instanceof Keepalive) {
                        // Keepalives are handled internally
-                       logger.debug("Received KeepAlive messsage.");
+                       LOG.debug("Received KeepAlive messsage.");
                        this.kaCounter++;
                        if (this.kaCounter >= 2) {
                                this.sync.kaReceived();
@@ -205,14 +205,14 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
                try {
                        this.channel.writeAndFlush(msg);
                        this.lastMessageSentAt = System.nanoTime();
-                       logger.debug("Sent message: {}", msg);
+                       LOG.debug("Sent message: {}", msg);
                } catch (final Exception e) {
-                       logger.warn("Message {} was not sent.", msg, e);
+                       LOG.warn("Message {} was not sent.", msg, e);
                }
        }
 
        private synchronized void closeWithoutMessage() {
-               logger.debug("Closing session: {}", this);
+               LOG.debug("Closing session: {}", this);
                this.channel.close();
                this.state = State.Idle;
        }
@@ -245,7 +245,7 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
                final long nextHold = this.lastMessageReceivedAt + TimeUnit.SECONDS.toNanos(holdTimerValue);
 
                if (ct >= nextHold) {
-                       logger.debug("HoldTimer expired. " + new Date());
+                       LOG.debug("HoldTimer expired. " + new Date());
                        this.terminate(BGPError.HOLD_TIMER_EXPIRED);
                } else {
                        this.stateTimer.newTimeout(new TimerTask() {
@@ -272,7 +272,7 @@ public class BGPSessionImpl extends AbstractProtocolSession<Notification> implem
                long nextKeepalive = this.lastMessageSentAt + TimeUnit.SECONDS.toNanos(this.keepAlive);
 
                if (ct >= nextKeepalive) {
-                       this.sendMessage(keepalive);
+                       this.sendMessage(KEEP_ALIVE);
                        nextKeepalive = this.lastMessageSentAt + TimeUnit.SECONDS.toNanos(this.keepAlive);
                }
                this.stateTimer.newTimeout(new TimerTask() {
index 38d80a9a4c633427d4c9fa33d895a70dd99f8f27..51b7f38f38b8dd2cc8198d4d676063ebe5f4e076 100644 (file)
@@ -66,7 +66,7 @@ public final class BGPSessionNegotiator extends AbstractSessionNegotiator<Notifi
                Finished,
        }
 
-       private static final Logger logger = LoggerFactory.getLogger(BGPSessionNegotiator.class);
+       private static final Logger LOG = LoggerFactory.getLogger(BGPSessionNegotiator.class);
        private final BGPSessionListener listener;
        private final Timer timer;
        private final BGPSessionPreferences localPref;
@@ -113,7 +113,7 @@ public final class BGPSessionNegotiator extends AbstractSessionNegotiator<Notifi
 
        @Override
        protected synchronized void handleMessage(final Notification msg) {
-               logger.debug("Channel {} handling message in state {}", this.channel, this.state);
+               LOG.debug("Channel {} handling message in state {}", this.channel, this.state);
 
                switch (this.state) {
                case Finished:
@@ -140,7 +140,7 @@ public final class BGPSessionNegotiator extends AbstractSessionNegotiator<Notifi
                }
 
                // Catch-all for unexpected message
-               logger.warn("Channel {} state {} unexpected message {}", this.channel, this.state, msg);
+               LOG.warn("Channel {} state {} unexpected message {}", this.channel, this.state, msg);
                this.channel.writeAndFlush(new NotifyBuilder().setErrorCode(BGPError.FSM_ERROR.getCode()).setErrorSubcode(
                                BGPError.FSM_ERROR.getSubcode()).build());
                negotiationFailed(new BGPDocumentedException("Unexpected message", BGPError.FSM_ERROR));
@@ -161,7 +161,7 @@ public final class BGPSessionNegotiator extends AbstractSessionNegotiator<Notifi
                                        this.channel.writeAndFlush(new KeepaliveBuilder().build());
                                        this.session = new BGPSessionImpl(this.timer, this.listener, this.channel, this.remotePref);
                                        this.state = State.OpenConfirm;
-                                       logger.debug("Channel {} moved to OpenConfirm state with remote proposal {}", this.channel, this.remotePref);
+                                       LOG.debug("Channel {} moved to OpenConfirm state with remote proposal {}", this.channel, this.remotePref);
                                        return;
                                }
                        }
index 8d8502d5c28fb2d285f77afb1a5c20af5132bd28..cae1d3a153e41db723ed028a1ad1ca4228e8bcb2 100644 (file)
@@ -36,7 +36,7 @@ import com.google.common.collect.Maps;
  */
 public class BGPSynchronization {
 
-       private static final Logger logger = LoggerFactory.getLogger(BGPSynchronization.class);
+       private static final Logger LOG = LoggerFactory.getLogger(BGPSynchronization.class);
 
        private static class SyncVariables {
 
@@ -100,7 +100,7 @@ public class BGPSynchronization {
                }
                final SyncVariables s = this.syncStorage.get(type);
                if (s == null) {
-                       logger.warn("BGPTableType was not present in open message : {}", type);
+                       LOG.warn("BGPTableType was not present in open message : {}", type);
                        return;
                }
                s.setUpd(true);
@@ -118,7 +118,7 @@ public class BGPSynchronization {
                                if (!s.getUpd()) {
                                        s.setEorTrue();
                                        final Update up = generateEOR(entry.getKey());
-                                       logger.debug("Sending synchronization message: {}", up);
+                                       LOG.debug("Sending synchronization message: {}", up);
                                        this.listener.onMessage(this.session, up);
                                }
                                s.setUpd(false);
index ae4b0cb286e4ae118bd34df61695b996059d5025..aea5cbda4f08b6f99b187a93fb2401235c96a15f 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.protocol.bgp.rib.impl.spi;
 
-
 /**
  * Interface that provides the initial acceptable session characteristics with which the session should be started.
  */
@@ -18,5 +17,5 @@ public interface BGPSessionProposal {
         * @param address serves as constraint, the implementation can also take time into consideration
         * @return BGPSessionPreferences with acceptable session characteristics
         */
-       public BGPSessionPreferences getProposal();
+       BGPSessionPreferences getProposal();
 }
index b4c6d1344fc246042c52cf664e04b47929368865..d376bf242635fe1359ddde5ccdaba732c06a1deb 100644 (file)
@@ -36,7 +36,7 @@ import com.google.common.base.Preconditions;
 
 @ThreadSafe
 public abstract class AbstractAdjRIBsIn<I, D extends DataObject> implements AdjRIBsIn {
-       protected static abstract class RIBEntryData<I, D extends DataObject> {
+       protected abstract static class RIBEntryData<I, D extends DataObject> {
                private final PathAttributes attributes;
 
                protected RIBEntryData(final PathAttributes attributes) {
@@ -92,7 +92,7 @@ public abstract class AbstractAdjRIBsIn<I, D extends DataObject> implements AdjR
                }
 
                private void electCandidate(final DataModificationTransaction transaction, final RIBEntryData<I, D> candidate) {
-                       LOG.trace("Electing state {} to supersede {}", candidate, currentState);
+                       LOG.trace("Electing state {} to supersede {}", candidate, this.currentState);
 
                        if (this.currentState == null || !this.currentState.equals(candidate)) {
                                transaction.putOperationalData(getName(), candidate.getDataObject(this.key));
@@ -108,11 +108,11 @@ public abstract class AbstractAdjRIBsIn<I, D extends DataObject> implements AdjR
                        if (candidate != null) {
                                electCandidate(transaction, candidate);
                        } else {
-                               LOG.trace("Final candidate disappeared, removing entry {}", name);
+                               LOG.trace("Final candidate disappeared, removing entry {}", this.name);
                                transaction.removeOperationalData(this.name);
                        }
 
-                       return candidates.isEmpty();
+                       return this.candidates.isEmpty();
                }
 
                synchronized void setState(final DataModificationTransaction transaction, final Peer peer, final RIBEntryData<I, D> state) {
@@ -136,20 +136,21 @@ public abstract class AbstractAdjRIBsIn<I, D extends DataObject> implements AdjR
                this.comparator = Preconditions.checkNotNull(comparator);
                this.basePath = InstanceIdentifier.builder(LocRib.class).child(Tables.class, key).toInstance();
 
-               eor = new UpdateBuilder().setPathAttributes(
+               this.eor = new UpdateBuilder().setPathAttributes(
                                new PathAttributesBuilder().addAugmentation(
                                                PathAttributes1.class,
                                                new PathAttributes1Builder().setMpReachNlri(
                                                                new MpReachNlriBuilder().setAfi(key.getAfi()).setSafi(key.getSafi()).build()).build()).build()).build();
 
-               trans.putOperationalData(basePath, new TablesBuilder().setAfi(key.getAfi()).setSafi(key.getSafi()).setUptodate(Boolean.FALSE).build());
+               trans.putOperationalData(this.basePath,
+                               new TablesBuilder().setAfi(key.getAfi()).setSafi(key.getSafi()).setUptodate(Boolean.FALSE).build());
        }
 
        private void setUptodate(final DataModificationTransaction trans, final Boolean uptodate) {
-               final Tables t = (Tables) trans.readOperationalData(basePath);
+               final Tables t = (Tables) trans.readOperationalData(this.basePath);
                if (t == null || !uptodate.equals(t.isUptodate())) {
                        LOG.debug("Table {} switching uptodate to {}", uptodate);
-                       trans.putOperationalData(basePath, new TablesBuilder(t).setUptodate(uptodate).build());
+                       trans.putOperationalData(this.basePath, new TablesBuilder(t).setUptodate(uptodate).build());
                }
        }
 
@@ -164,8 +165,8 @@ public abstract class AbstractAdjRIBsIn<I, D extends DataObject> implements AdjR
                        }
                }
 
-               peers.remove(peer);
-               setUptodate(trans, peers.values().contains(Boolean.FALSE) == false);
+               this.peers.remove(peer);
+               setUptodate(trans, !this.peers.values().contains(Boolean.FALSE));
        }
 
        protected abstract InstanceIdentifier<?> identifierForKey(final InstanceIdentifier<Tables> basePath, final I id);
@@ -178,8 +179,8 @@ public abstract class AbstractAdjRIBsIn<I, D extends DataObject> implements AdjR
                }
 
                e.setState(trans, peer, data);
-               if (!peers.containsKey(peer)) {
-                       peers.put(peer, Boolean.FALSE);
+               if (!this.peers.containsKey(peer)) {
+                       this.peers.put(peer, Boolean.FALSE);
                        setUptodate(trans, Boolean.FALSE);
                }
        }
@@ -194,12 +195,12 @@ public abstract class AbstractAdjRIBsIn<I, D extends DataObject> implements AdjR
 
        @Override
        public final void markUptodate(final DataModificationTransaction trans, final Peer peer) {
-               peers.put(peer, Boolean.TRUE);
-               setUptodate(trans, peers.values().contains(Boolean.FALSE) == false);
+               this.peers.put(peer, Boolean.TRUE);
+               setUptodate(trans, !this.peers.values().contains(Boolean.FALSE));
        }
 
        @Override
        public final Update endOfRib() {
-               return eor;
+               return this.eor;
        }
 }
index 1b23cd3e4baf467e2f5a242df400096f7ece817e..81ba61e691777f98ae63e0da89fa4232b8673acc 100644 (file)
@@ -26,14 +26,14 @@ public abstract class AbstractRIBExtensionProviderActivator implements RIBExtens
        protected abstract List<AutoCloseable> startRIBExtensionProviderImpl(RIBExtensionProviderContext context);
 
        @Override
-       public synchronized final void startRIBExtensionProvider(final RIBExtensionProviderContext context) {
+       public final synchronized void startRIBExtensionProvider(final RIBExtensionProviderContext context) {
                Preconditions.checkState(this.registrations == null);
 
                this.registrations = Preconditions.checkNotNull(startRIBExtensionProviderImpl(context));
        }
 
        @Override
-       public synchronized final void stopRIBExtensionProvider() {
+       public final synchronized void stopRIBExtensionProvider() {
                Preconditions.checkState(this.registrations != null);
 
                for (final AutoCloseable r : this.registrations) {
index 059788c5a24445cb1a28a047a70c9ce87d4a1038..89257942b91519ff37a12531e8849678ff7a8344 100644 (file)
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
  */
 public class Main {
 
-       private static final Logger logger = LoggerFactory.getLogger(Main.class);
+       private static final Logger LOG = LoggerFactory.getLogger(Main.class);
 
        private static String usage = "DESCRIPTION:\n"
                        + "\tCreates a server with given parameters. As long as it runs, it accepts connections " + "from PCCs.\n" + "USAGE:\n"
@@ -80,7 +80,7 @@ public class Main {
                                as = new AsNumber(Long.valueOf(args[i + 1]));
                                i++;
                        } else {
-                               logger.error("WARNING: Unrecognized argument: " + args[i]);
+                               LOG.error("WARNING: Unrecognized argument: " + args[i]);
                        }
                        i++;
                }
@@ -93,7 +93,7 @@ public class Main {
 
                final BGPSessionPreferences proposal = prop.getProposal();
 
-               logger.debug("{} {} {}", address, sessionListener, proposal);
+               LOG.debug("{} {} {}", address, sessionListener, proposal);
 
                final InetSocketAddress addr = address;
                m.dispatcher.createClient(addr, proposal, sessionListener,
index 617797df0bcdaf22bec4ec9eda42335d3cca591b..545e82bdeaeba7d7fd2e09b8251a166916d21535 100644 (file)
@@ -18,26 +18,26 @@ import org.slf4j.LoggerFactory;
  * Testing BGP Listener.
  */
 public class TestingListener implements BGPSessionListener {
-       private static final Logger logger = LoggerFactory.getLogger(TestingListener.class);
+       private static final Logger LOG = LoggerFactory.getLogger(TestingListener.class);
 
        @Override
        public void onMessage(final BGPSession session, final Notification message) {
-               logger.info("Client Listener: message received: {}", message.toString());
+               LOG.info("Client Listener: message received: {}", message.toString());
        }
 
        @Override
        public void onSessionUp(final BGPSession session) {
-               logger.info("Client Listener: Session Up.");
+               LOG.info("Client Listener: Session Up.");
        }
 
        @Override
        public void onSessionDown(final BGPSession session, final Exception e) {
-               logger.info("Client Listener: Connection lost.");
+               LOG.info("Client Listener: Connection lost.");
                session.close();
        }
 
        @Override
        public void onSessionTerminated(final BGPSession session, final BGPTerminationReason cause) {
-               logger.info("Client Listener: Connection lost: {}.", cause);
+               LOG.info("Client Listener: Connection lost: {}.", cause);
        }
 }