Fix a few warnings in openflowplugin-impl 77/110477/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Mar 2024 16:16:19 +0000 (17:16 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Mar 2024 16:16:19 +0000 (17:16 +0100)
Fixup use of deprecated MD-SAL methods and the way static methods are
invoked.

Change-Id: I7586c080cce4e30b805fb0fbd6d6c490c9be6c68
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/connection/ConnectionManagerImpl.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/services/sal/ProcessFlatBatchImplTest.java

index d08c1254729c0d82a90801ca44c0ecfd9a70592b..4ea8039319b8377e36f22dcdcb09d40df3b7e50d 100644 (file)
@@ -196,7 +196,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
             requireNonNull(changes, "Changes must not be null!");
             for (DataTreeModification<Node> change : changes) {
                 final DataObjectModification<Node> mod = change.getRootNode();
-                switch (mod.getModificationType()) {
+                switch (mod.modificationType()) {
                     case DELETE:
                         break;
                     case SUBTREE_MODIFIED:
@@ -205,7 +205,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
                         processNodeModification(change);
                         break;
                     default:
-                        throw new IllegalArgumentException("Unhandled modification type " + mod.getModificationType());
+                        throw new IllegalArgumentException("Unhandled modification type " + mod.modificationType());
                 }
             }
         }
@@ -215,7 +215,7 @@ public class ConnectionManagerImpl implements ConnectionManager {
         }
 
         private void processNodeModification(final DataTreeModification<Node> change) {
-            final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
+            final InstanceIdentifier<Node> key = change.getRootPath().path();
             final InstanceIdentifier<Node> nodeIdent = key.firstIdentifierOf(Node.class);
             String[] nodeIdentity = nodeIdent.firstKeyOf(Node.class).getId().getValue().split(":");
             String nodeId = nodeIdentity[1];
index 54074092a4b610e1ead41f7d3cbba9320c5e078f..ad5a55285cc15d108ea61050f1056688fcad9162 100644 (file)
@@ -498,7 +498,7 @@ public class ProcessFlatBatchImplTest {
         when(batchStepJob2.getStepFunction().apply(any())).thenReturn(failedChainOutput);
 
         final List<BatchStepJob> batchChainElements = Lists.newArrayList(batchStepJob1, batchStepJob2);
-        final var rpcResultFuture = processFlatBatch.executeBatchPlan(batchChainElements);
+        final var rpcResultFuture = ProcessFlatBatchImpl.executeBatchPlan(batchChainElements);
 
         assertTrue(rpcResultFuture.isDone());
         final var rpcResult = rpcResultFuture.get();
@@ -551,7 +551,7 @@ public class ProcessFlatBatchImplTest {
                         .success(new AddFlowsBatchOutputBuilder().build())
                         .buildFuture());
 
-        final var rpcResultFuture = processFlatBatch.executeBatchPlan(batchChain);
+        final var rpcResultFuture = ProcessFlatBatchImpl.executeBatchPlan(batchChain);
         assertTrue(rpcResultFuture.isDone());
         final var rpcResult = rpcResultFuture.get();
         assertTrue(rpcResult.isSuccessful());
@@ -597,7 +597,7 @@ public class ProcessFlatBatchImplTest {
                         .withError(ErrorType.APPLICATION, "ut-addFlowBatchError")
                         .buildFuture());
 
-        final var rpcResultFuture = processFlatBatch.executeBatchPlan(batchChain);
+        final var rpcResultFuture = ProcessFlatBatchImpl.executeBatchPlan(batchChain);
         assertTrue(rpcResultFuture.isDone());
         final var rpcResult = rpcResultFuture.get();
         assertFalse(rpcResult.isSuccessful());