Fixed some sonar issues 34/19634/1
authorLadislav Borak <lborak@cisco.com>
Tue, 5 May 2015 15:24:22 +0000 (17:24 +0200)
committerLadislav Borak <lborak@cisco.com>
Tue, 5 May 2015 15:24:22 +0000 (17:24 +0200)
- local variables should not shadow classfields

Change-Id: I10ce99bb4317f846fa3f1984a34a38a2f6b9b831
Signed-off-by: Ladislav Borak <lborak@cisco.com>
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FlowspecRIBSupport.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/LinkstateRIBSupport.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/ExportPolicyPeerTracker.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/IPv4RIBSupport.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/IPv6RIBSupport.java
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/RIBImpl.java

index 6d554a049ffc7ecd0bc6c822c01e359269d1f471..7f1806c84da1a3f4fab31b12cdbc9792d8bb82cb 100644 (file)
@@ -173,8 +173,8 @@ final class FlowspecRIBSupport extends AbstractRIBSupport {
         mb.setCNextHop(hop);
 
         final List<Flowspec> dests = new ArrayList<>(routes.size());
-        for (final MapEntryNode route : routes) {
-            dests.add(FSNlriParser.extractFlowspec(route));
+        for (final MapEntryNode reachRoute : routes) {
+            dests.add(FSNlriParser.extractFlowspec(reachRoute));
         }
         mb.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
             new DestinationFlowspecCaseBuilder().setDestinationFlowspec(
@@ -189,8 +189,8 @@ final class FlowspecRIBSupport extends AbstractRIBSupport {
         mb.setSafi(FlowspecSubsequentAddressFamily.class);
 
         final List<Flowspec> dests = new ArrayList<>(routes.size());
-        for (final MapEntryNode route : routes) {
-            dests.add(FSNlriParser.extractFlowspec(route));
+        for (final MapEntryNode unreachRoute : routes) {
+            dests.add(FSNlriParser.extractFlowspec(unreachRoute));
         }
         mb.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
             new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150114.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationFlowspecCaseBuilder().setDestinationFlowspec(
index e65109c8d74e12e4cb26b86a3136de8e1cc9019f..c39eb5b2289946205eb2aefd68e798978c4f63be 100644 (file)
@@ -182,8 +182,8 @@ final class LinkstateRIBSupport extends AbstractRIBSupport {
         mb.setCNextHop(hop);
 
         final List<CLinkstateDestination> dests = new ArrayList<>(routes.size());
-        for (final MapEntryNode route : routes) {
-            dests.add(LinkstateNlriParser.extractLinkstateDestination(route));
+        for (final MapEntryNode reachRoute : routes) {
+            dests.add(LinkstateNlriParser.extractLinkstateDestination(reachRoute));
         }
         mb.setAdvertizedRoutes(new AdvertizedRoutesBuilder().setDestinationType(
             new DestinationLinkstateCaseBuilder().setDestinationLinkstate(
@@ -198,8 +198,8 @@ final class LinkstateRIBSupport extends AbstractRIBSupport {
         mb.setSafi(LinkstateSubsequentAddressFamily.class);
 
         final List<CLinkstateDestination> dests = new ArrayList<>(routes.size());
-        for (final MapEntryNode route : routes) {
-            dests.add(LinkstateNlriParser.extractLinkstateDestination(route));
+        for (final MapEntryNode unreachRoute : routes) {
+            dests.add(LinkstateNlriParser.extractLinkstateDestination(unreachRoute));
         }
         mb.setWithdrawnRoutes(new WithdrawnRoutesBuilder().setDestinationType(
             new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev150210.update.attributes.mp.unreach.nlri.withdrawn.routes.destination.type.DestinationLinkstateCaseBuilder().setDestinationLinkstate(
index 561981e4f47f7ba14182533d4685b93ace8fcf1f..04e624276a4251249082ffb984557f583dc3f3df 100644 (file)
@@ -65,14 +65,14 @@ final class ExportPolicyPeerTracker extends AbstractPeerRoleTracker {
         }
 
         // Optimized immutable copy, reused for all PeerGroups
-        final Map<PeerId, PeerRole> peerRoles = ImmutableMap.copyOf(idToRole);
+        final Map<PeerId, PeerRole> allPeerRoles = ImmutableMap.copyOf(idToRole);
 
         final Map<PeerRole, PeerExportGroup> ret = new EnumMap<>(PeerRole.class);
         for (Entry<PeerRole, Collection<YangInstanceIdentifier>> e : roleToIds.asMap().entrySet()) {
             final AbstractExportPolicy policy = policyDatabase.exportPolicyForRole(e.getKey());
             final Collection<Entry<PeerId, YangInstanceIdentifier>> peers = ImmutableList.copyOf(Collections2.transform(e.getValue(), GENERATE_PEERID));
 
-            ret.put(e.getKey(), new PeerExportGroup(peers, peerRoles, policy));
+            ret.put(e.getKey(), new PeerExportGroup(peers, allPeerRoles, policy));
         }
 
         return ret;
index d3b9b297a07f217e301c7a562e0ecc8c8309c7d1..ebd1e8d8d91c16db8e883d9332ad3cf283e65305 100644 (file)
@@ -99,8 +99,8 @@ final class IPv4RIBSupport extends AbstractIPRIBSupport {
 
     private List<Ipv4Prefixes> extractPrefixes(final Collection<MapEntryNode> routes) {
         final List<Ipv4Prefixes> prefs = new ArrayList<>(routes.size());
-        for (final MapEntryNode route : routes) {
-            final String prefix = (String) route.getChild(this.routeKeyLeaf).get().getValue();
+        for (final MapEntryNode ipv4Route : routes) {
+            final String prefix = (String) ipv4Route.getChild(this.routeKeyLeaf).get().getValue();
             prefs.add(new Ipv4PrefixesBuilder().setPrefix(new Ipv4Prefix(prefix)).build());
         }
         return prefs;
index d144f6fa75fb9a8efc7493979ef719acd09cb290..7c685844989a1e8d5a9aa861144341916e456bbf 100644 (file)
@@ -97,8 +97,8 @@ final class IPv6RIBSupport extends AbstractIPRIBSupport {
 
     private List<Ipv6Prefixes> extractPrefixes(final Collection<MapEntryNode> routes) {
         final List<Ipv6Prefixes> prefs = new ArrayList<>(routes.size());
-        for (final MapEntryNode route : routes) {
-            final String prefix = (String) route.getChild(this.routeKeyLeaf).get().getValue();
+        for (final MapEntryNode ipv6Route : routes) {
+            final String prefix = (String) ipv6Route.getChild(this.routeKeyLeaf).get().getValue();
             prefs.add(new Ipv6PrefixesBuilder().setPrefix(new Ipv6Prefix(prefix)).build());
         }
         return prefs;
index cc68033f6cf5f23b2ce84e24e433731c860fedd2..935eab64f730d0a169e0e808942d89dd0bf6d9ff 100644 (file)
@@ -142,8 +142,8 @@ public final class RIBImpl extends DefaultRibReference implements AutoCloseable,
 
         final PolicyDatabase pd  = new PolicyDatabase(localAs.getValue(), localBgpId, this.clusterId);
 
-        final DOMDataBrokerExtension service = this.domDataBroker.getSupportedExtensions().get(DOMDataTreeChangeService.class);
-        this.service = service;
+        final DOMDataBrokerExtension domDatatreeChangeService = this.domDataBroker.getSupportedExtensions().get(DOMDataTreeChangeService.class);
+        this.service = domDatatreeChangeService;
         this.efWriter = EffectiveRibInWriter.create(getService(), this.createPeerChain(this), getYangRibId(), pd, this.ribContextRegistry);
         LOG.debug("Effective RIB created.");