Eliminate another prepareBatchedModifications() method 90/114190/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 25 Oct 2024 12:46:43 +0000 (14:46 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 25 Oct 2024 12:46:43 +0000 (14:46 +0200)
We are using this method only indirectly, merge it into its sole caller.

Change-Id: Ic414449778eead545cfbf7b713a307b8f0e429f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java

index 2ed397cdac8fb908825209048b927f6e0068d091..88a564f83200aecdf18e26689f3ea34e3f377832 100644 (file)
@@ -256,9 +256,10 @@ public abstract class AbstractShardTest extends AbstractActorTest {
     }
 
     protected static BatchedModifications prepareBatchedModifications(final TransactionIdentifier transactionID,
-                                                             final MutableCompositeModification modification,
-                                                             final boolean doCommitOnReady) {
-        final BatchedModifications batchedModifications = new BatchedModifications(transactionID, CURRENT_VERSION);
+            final YangInstanceIdentifier path, final NormalizedNode data, final boolean doCommitOnReady) {
+        final var modification = new MutableCompositeModification();
+        modification.addModification(new WriteModification(path, data));
+        final var batchedModifications = new BatchedModifications(transactionID, CURRENT_VERSION);
         batchedModifications.addModification(modification);
         batchedModifications.setReady();
         batchedModifications.setDoCommitOnReady(doCommitOnReady);
@@ -266,13 +267,6 @@ public abstract class AbstractShardTest extends AbstractActorTest {
         return batchedModifications;
     }
 
-    protected static BatchedModifications prepareBatchedModifications(final TransactionIdentifier transactionID,
-            final YangInstanceIdentifier path, final NormalizedNode data, final boolean doCommitOnReady) {
-        final MutableCompositeModification modification = new MutableCompositeModification();
-        modification.addModification(new WriteModification(path, data));
-        return prepareBatchedModifications(transactionID, modification, doCommitOnReady);
-    }
-
     protected static ForwardedReadyTransaction prepareForwardedReadyTransaction(final TestActorRef<Shard> shard,
             final TransactionIdentifier transactionID, final YangInstanceIdentifier path,
             final NormalizedNode data, final boolean doCommitOnReady) {