Move future declaration 82/105382/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 11 Apr 2023 17:20:16 +0000 (19:20 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 11 Apr 2023 17:20:16 +0000 (19:20 +0200)
Co-locate declaration and initialization.

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

index 6a0996bd7eb07b0b5fc0b19ff6b29a7076de01c9..9483f85b414e836c1e4917b19ac73189b480f360 100644 (file)
@@ -605,7 +605,6 @@ public class BGPPeer extends AbstractPeer implements BGPSessionListener {
     }
 
     private synchronized FluentFuture<? extends CommitInfo> terminateConnection() {
-        final FluentFuture<? extends CommitInfo> future;
         if (trackerRegistration != null) {
             trackerRegistration.close();
             trackerRegistration = null;
@@ -620,7 +619,7 @@ public class BGPPeer extends AbstractPeer implements BGPSessionListener {
         }
         tables = ImmutableSet.of();
         addPathTableMaps = ImmutableMap.of();
-        future = removePeer(peerPath);
+        final var future = removePeer(peerPath);
         resetState();
 
         return future;