Fix ClusterSingleton future type 86/72186/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 23 May 2018 09:36:42 +0000 (11:36 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 23 May 2018 09:36:42 +0000 (11:36 +0200)
The type changed from Void to ? extends Object, adjust for this
change.

Change-Id: I91aaa511770174ba0c2e81df2b1d8bfb92ee8b23
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/ContextChainImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/GuardedContextImpl.java

index ff58ba0e7d2e61097151dacbd48fdaaa5f9364a1..0f116b34cdd2c638a95d6f4cc850a0e372ed553c 100644 (file)
@@ -81,15 +81,13 @@ public class ContextChainImpl implements ContextChain {
     }
 
     @Override
-    public ListenableFuture<Void> closeServiceInstance() {
+    public ListenableFuture<?> closeServiceInstance() {
 
         contextChainMastershipWatcher.onSlaveRoleAcquired(deviceInfo);
 
-        final ListenableFuture<List<Void>> servicesToBeClosed = Futures
-                .allAsList(Lists.reverse(contexts)
-                        .stream()
-                        .map(OFPContext::closeServiceInstance)
-                        .collect(Collectors.toList()));
+        final ListenableFuture<?> servicesToBeClosed = Futures.allAsList(Lists.reverse(contexts).stream()
+            .map(OFPContext::closeServiceInstance)
+            .collect(Collectors.toList()));
 
         return Futures.transform(servicesToBeClosed, (input) -> {
             LOG.info("Closed clustering services for node {}", deviceInfo);
index aae88d9ff2e1fd209b619701962f21b2475673c5..fc7cf9ef2f66efe8d8399b6581b7982dc08bee6e 100644 (file)
@@ -95,18 +95,18 @@ public class GuardedContextImpl implements GuardedContext {
 
     @Override
     @SuppressWarnings("checkstyle:IllegalCatch")
-    public ListenableFuture<Void> closeServiceInstance() {
-        ListenableFuture<Void> result = Futures.immediateFuture(null);
+    public ListenableFuture<?> closeServiceInstance() {
+        ListenableFuture<?> result = Futures.immediateFuture(null);
 
         if (monitor.enterIf(isStoppable)) {
             try {
                 LOG.info("Stopping {} service for node {}", this, getDeviceInfo());
                 state = STOPPING;
-                final ListenableFuture<Void> resultFuture = delegate.closeServiceInstance();
+                final ListenableFuture<?> resultFuture = delegate.closeServiceInstance();
 
-                Futures.addCallback(resultFuture, new FutureCallback<Void>() {
+                Futures.addCallback(resultFuture, new FutureCallback<Object>() {
                     @Override
-                    public void onSuccess(@Nullable final Void result) {
+                    public void onSuccess(@Nullable final Object result) {
                         state = TERMINATED;
                     }
 
@@ -161,4 +161,4 @@ public class GuardedContextImpl implements GuardedContext {
             }
         }
     }
-}
\ No newline at end of file
+}