Fix checkstyle in BgpDeployerImpl 27/80827/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Mar 2019 10:55:51 +0000 (11:55 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Mar 2019 11:46:09 +0000 (12:46 +0100)
Rename local variable to prevent a clash and suppress warnings
on catch of exception.

Change-Id: I09c01201f59a7d5d676a62d529364dd525e801aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/config/BgpDeployerImpl.java

index 9e23d684b1520a84eefff494745027b67a2ca4e2..90e2e0d8ec8b64e06d1352137ee3354dbd553142 100644 (file)
@@ -220,19 +220,20 @@ public final class BgpDeployerImpl implements ClusteredDataTreeChangeListener<Bg
     }
 
     private synchronized void rebootNeighbors(final DataObjectModification<PeerGroups> dataObjectModification) {
-        PeerGroups peerGroups = dataObjectModification.getDataAfter();
-        if (peerGroups == null) {
-            peerGroups = dataObjectModification.getDataBefore();
+        PeerGroups extPeerGroups = dataObjectModification.getDataAfter();
+        if (extPeerGroups == null) {
+            extPeerGroups = dataObjectModification.getDataBefore();
         }
-        if (peerGroups == null) {
+        if (extPeerGroups == null) {
             return;
         }
-        for (final PeerGroup peerGroup : peerGroups.getPeerGroup()) {
+        for (final PeerGroup peerGroup : extPeerGroups.getPeerGroup()) {
             this.bgpCss.values().forEach(css -> css.restartNeighbors(peerGroup.getPeerGroupName()));
         }
     }
 
     @Override
+    @SuppressWarnings("checkstyle:illegalCatch")
     public synchronized void close() {
         LOG.info("Closing BGP Deployer.");
         if (this.registration != null) {
@@ -245,10 +246,9 @@ public final class BgpDeployerImpl implements ClusteredDataTreeChangeListener<Bg
             try {
                 service.close();
             } catch (Exception e) {
-                LOG.warn("Failed to close BGP Cluster Singleton Service.");
+                LOG.warn("Failed to close BGP Cluster Singleton Service.", e);
             }
         });
-
     }
 
     private static FluentFuture<? extends CommitInfo> initializeNetworkInstance(