diff --git a/platform-sdk/platform-apps/demos/CryptocurrencyDemo/src/main/java/com/swirlds/demo/crypto/CryptocurrencyDemoState.java b/platform-sdk/platform-apps/demos/CryptocurrencyDemo/src/main/java/com/swirlds/demo/crypto/CryptocurrencyDemoState.java index 624f1bc15dcf..67bf3acd5581 100644 --- a/platform-sdk/platform-apps/demos/CryptocurrencyDemo/src/main/java/com/swirlds/demo/crypto/CryptocurrencyDemoState.java +++ b/platform-sdk/platform-apps/demos/CryptocurrencyDemo/src/main/java/com/swirlds/demo/crypto/CryptocurrencyDemoState.java @@ -211,9 +211,7 @@ public synchronized CryptocurrencyDemoState copy() { public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { throwIfImmutable(); round.forEachEventTransaction((event, transaction) -> handleTransaction(event.getCreatorId(), transaction)); } diff --git a/platform-sdk/platform-apps/demos/HelloSwirldDemo/src/main/java/com/swirlds/demo/hello/HelloSwirldDemoState.java b/platform-sdk/platform-apps/demos/HelloSwirldDemo/src/main/java/com/swirlds/demo/hello/HelloSwirldDemoState.java index c7d66c8090df..70d659567fb0 100644 --- a/platform-sdk/platform-apps/demos/HelloSwirldDemo/src/main/java/com/swirlds/demo/hello/HelloSwirldDemoState.java +++ b/platform-sdk/platform-apps/demos/HelloSwirldDemo/src/main/java/com/swirlds/demo/hello/HelloSwirldDemoState.java @@ -111,9 +111,7 @@ private HelloSwirldDemoState(final HelloSwirldDemoState sourceState) { public synchronized void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { throwIfImmutable(); round.forEachTransaction(this::handleTransaction); } diff --git a/platform-sdk/platform-apps/demos/StatsDemo/src/main/java/com/swirlds/demo/stats/StatsDemoState.java b/platform-sdk/platform-apps/demos/StatsDemo/src/main/java/com/swirlds/demo/stats/StatsDemoState.java index 64d9e5a976f5..10d59a52847b 100644 --- a/platform-sdk/platform-apps/demos/StatsDemo/src/main/java/com/swirlds/demo/stats/StatsDemoState.java +++ b/platform-sdk/platform-apps/demos/StatsDemo/src/main/java/com/swirlds/demo/stats/StatsDemoState.java @@ -36,7 +36,6 @@ import com.swirlds.platform.system.Round; import com.swirlds.platform.system.SoftwareVersion; import edu.umd.cs.findbugs.annotations.NonNull; -import java.util.List; import java.util.function.Consumer; import java.util.function.Function; @@ -83,9 +82,7 @@ private StatsDemoState(final StatsDemoState sourceState) { public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) {} + @NonNull final Consumer> stateSignatureTransaction) {} /** * {@inheritDoc} diff --git a/platform-sdk/platform-apps/tests/AddressBookTestingTool/src/main/java/com/swirlds/demo/addressbook/AddressBookTestingToolState.java b/platform-sdk/platform-apps/tests/AddressBookTestingTool/src/main/java/com/swirlds/demo/addressbook/AddressBookTestingToolState.java index 76f36aafdae0..6614c1624baa 100644 --- a/platform-sdk/platform-apps/tests/AddressBookTestingTool/src/main/java/com/swirlds/demo/addressbook/AddressBookTestingToolState.java +++ b/platform-sdk/platform-apps/tests/AddressBookTestingTool/src/main/java/com/swirlds/demo/addressbook/AddressBookTestingToolState.java @@ -71,7 +71,6 @@ import java.text.ParseException; import java.time.Duration; import java.util.Iterator; -import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; @@ -222,9 +221,7 @@ public void init( public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { Objects.requireNonNull(round, "the round cannot be null"); Objects.requireNonNull(platformState, "the platform state cannot be null"); throwIfImmutable(); diff --git a/platform-sdk/platform-apps/tests/ConsistencyTestingTool/src/main/java/com/swirlds/demo/consistency/ConsistencyTestingToolState.java b/platform-sdk/platform-apps/tests/ConsistencyTestingTool/src/main/java/com/swirlds/demo/consistency/ConsistencyTestingToolState.java index c0313c161976..5e25d3b0eacb 100644 --- a/platform-sdk/platform-apps/tests/ConsistencyTestingTool/src/main/java/com/swirlds/demo/consistency/ConsistencyTestingToolState.java +++ b/platform-sdk/platform-apps/tests/ConsistencyTestingTool/src/main/java/com/swirlds/demo/consistency/ConsistencyTestingToolState.java @@ -44,7 +44,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.time.Duration; -import java.util.List; import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -246,9 +245,7 @@ private void applyTransactionToState(final @NonNull ConsensusTransaction transac @Override public void preHandle( @NonNull final Event event, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { event.forEachTransaction(transaction -> { if (transaction.isSystem()) { return; @@ -272,9 +269,7 @@ public void preHandle( public void handleConsensusRound( final @NonNull Round round, final @NonNull PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { Objects.requireNonNull(round); Objects.requireNonNull(platformState); diff --git a/platform-sdk/platform-apps/tests/ISSTestingTool/src/main/java/com/swirlds/demo/iss/ISSTestingToolState.java b/platform-sdk/platform-apps/tests/ISSTestingTool/src/main/java/com/swirlds/demo/iss/ISSTestingToolState.java index f78d3e6eebc4..78d7515250be 100644 --- a/platform-sdk/platform-apps/tests/ISSTestingTool/src/main/java/com/swirlds/demo/iss/ISSTestingToolState.java +++ b/platform-sdk/platform-apps/tests/ISSTestingTool/src/main/java/com/swirlds/demo/iss/ISSTestingToolState.java @@ -243,9 +243,7 @@ void writeObjectByChildIndex(int index, List lis public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { throwIfImmutable(); final Iterator eventIterator = round.iterator(); diff --git a/platform-sdk/platform-apps/tests/MigrationTestingTool/src/main/java/com/swirlds/demo/migration/MigrationTestingToolState.java b/platform-sdk/platform-apps/tests/MigrationTestingTool/src/main/java/com/swirlds/demo/migration/MigrationTestingToolState.java index 504679ccff2e..7ec5c81b4690 100644 --- a/platform-sdk/platform-apps/tests/MigrationTestingTool/src/main/java/com/swirlds/demo/migration/MigrationTestingToolState.java +++ b/platform-sdk/platform-apps/tests/MigrationTestingTool/src/main/java/com/swirlds/demo/migration/MigrationTestingToolState.java @@ -285,9 +285,7 @@ public void init( public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { throwIfImmutable(); for (final Iterator eventIt = round.iterator(); eventIt.hasNext(); ) { final ConsensusEvent event = eventIt.next(); diff --git a/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/java/com/swirlds/demo/platform/PlatformTestingToolState.java b/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/java/com/swirlds/demo/platform/PlatformTestingToolState.java index 48a2b0ea9694..518d1445a862 100644 --- a/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/java/com/swirlds/demo/platform/PlatformTestingToolState.java +++ b/platform-sdk/platform-apps/tests/PlatformTestingTool/src/main/java/com/swirlds/demo/platform/PlatformTestingToolState.java @@ -1056,9 +1056,7 @@ protected void preHandleTransaction(final Transaction transaction) { public synchronized void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { throwIfImmutable(); if (!initialized.get()) { throw new IllegalStateException("handleConsensusRound() called before init()"); @@ -1662,9 +1660,7 @@ private static class ChildIndices { @Override public void preHandle( @NonNull final Event event, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { event.forEachTransaction(this::preHandleTransaction); } } diff --git a/platform-sdk/platform-apps/tests/StatsSigningTestingTool/src/main/java/com/swirlds/demo/stats/signing/StatsSigningTestingToolState.java b/platform-sdk/platform-apps/tests/StatsSigningTestingTool/src/main/java/com/swirlds/demo/stats/signing/StatsSigningTestingToolState.java index dabd0b8fff3c..5a2d95eb0f19 100644 --- a/platform-sdk/platform-apps/tests/StatsSigningTestingTool/src/main/java/com/swirlds/demo/stats/signing/StatsSigningTestingToolState.java +++ b/platform-sdk/platform-apps/tests/StatsSigningTestingTool/src/main/java/com/swirlds/demo/stats/signing/StatsSigningTestingToolState.java @@ -115,9 +115,7 @@ public synchronized StatsSigningTestingToolState copy() { @Override public void preHandle( @NonNull final Event event, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { final SttTransactionPool sttTransactionPool = transactionPoolSupplier.get(); if (sttTransactionPool != null) { event.forEachTransaction(transaction -> { @@ -141,9 +139,7 @@ public void preHandle( public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { throwIfImmutable(); round.forEachTransaction(this::handleTransaction); } diff --git a/platform-sdk/platform-apps/tests/StressTestingTool/src/main/java/com/swirlds/demo/stress/StressTestingToolState.java b/platform-sdk/platform-apps/tests/StressTestingTool/src/main/java/com/swirlds/demo/stress/StressTestingToolState.java index 3225ecffe8f3..347b5dfb0cff 100644 --- a/platform-sdk/platform-apps/tests/StressTestingTool/src/main/java/com/swirlds/demo/stress/StressTestingToolState.java +++ b/platform-sdk/platform-apps/tests/StressTestingTool/src/main/java/com/swirlds/demo/stress/StressTestingToolState.java @@ -43,7 +43,6 @@ import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; import java.time.Duration; -import java.util.List; import java.util.function.Consumer; import java.util.function.Function; @@ -103,9 +102,7 @@ public void init( @Override public void preHandle( @NonNull final Event event, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { busyWait(config.preHandleTime()); } @@ -116,9 +113,7 @@ public void preHandle( public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { throwIfImmutable(); round.forEachTransaction(this::handleTransaction); } diff --git a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/eventhandling/DefaultTransactionPrehandler.java b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/eventhandling/DefaultTransactionPrehandler.java index 6ddb39c0aade..884991c5eb80 100644 --- a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/eventhandling/DefaultTransactionPrehandler.java +++ b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/eventhandling/DefaultTransactionPrehandler.java @@ -42,7 +42,7 @@ public class DefaultTransactionPrehandler implements TransactionPrehandler { private static final Logger logger = LogManager.getLogger(DefaultTransactionPrehandler.class); - public static final Consumer>> NO_OP_CONSUMER = + public static final Consumer> NO_OP_CONSUMER = systemTransactions -> {}; /** diff --git a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/state/PlatformMerkleStateRoot.java b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/state/PlatformMerkleStateRoot.java index b6c9b1c7fc37..7fff84b01b46 100644 --- a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/state/PlatformMerkleStateRoot.java +++ b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/state/PlatformMerkleStateRoot.java @@ -48,7 +48,6 @@ import com.swirlds.state.spi.WritableStates; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; -import java.util.List; import java.util.function.Consumer; import java.util.function.Function; @@ -153,9 +152,7 @@ protected PlatformMerkleStateRoot copyingConstructor() { public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { throwIfImmutable(); lifecycles.onHandleConsensusRound(round, this); } @@ -173,9 +170,7 @@ public void sealConsensusRound(@NonNull final Round round) { @Override public void preHandle( @NonNull final Event event, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { lifecycles.onPreHandle(event, this); } diff --git a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/state/SwirldStateManager.java b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/state/SwirldStateManager.java index ce99739dc690..06a9d89e1456 100644 --- a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/state/SwirldStateManager.java +++ b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/state/SwirldStateManager.java @@ -123,7 +123,7 @@ public void setInitialState(@NonNull final MerkleRoot state) { /** * Handles the events in a consensus round. Implementations are responsible for invoking - * {@link SwirldState#handleConsensusRound(Round, PlatformStateModifier, Consumer>>)}. + * {@link SwirldState#handleConsensusRound(Round, PlatformStateModifier, Consumer>)}. * * @param round the round to handle */ diff --git a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/system/SwirldState.java b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/system/SwirldState.java index a6d0368bea77..c49f3047d4d1 100644 --- a/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/system/SwirldState.java +++ b/platform-sdk/swirlds-platform-core/src/main/java/com/swirlds/platform/system/SwirldState.java @@ -26,7 +26,6 @@ import com.swirlds.platform.system.transaction.Transaction; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.Nullable; -import java.util.List; import java.util.Objects; import java.util.function.Consumer; @@ -72,25 +71,25 @@ default void init( * This method is always invoked on an immutable state. * * @param event the event to perform pre-handling on - * @param stateSignatureTransactions a consumer that accepts a list of {@link ScopedSystemTransaction}s that + * @param stateSignatureTransaction a consumer that accepts a list of {@link ScopedSystemTransaction}s that * will be used for callbacks */ default void preHandle( final Event event, - final Consumer>> stateSignatureTransactions) {} + final Consumer> stateSignatureTransaction) {} /** * This method should apply the transactions in the provided round to the state. Only called on mutable states. * * @param round the round to apply * @param platformState the platform state - * @param stateSignatureTransactions a consumer that accepts a list of {@link ScopedSystemTransaction}s that + * @param stateSignatureTransaction a consumer that accepts a list of {@link ScopedSystemTransaction}s that * will be used for callbacks */ void handleConsensusRound( final Round round, final PlatformStateModifier platformState, - final Consumer>> stateSignatureTransactions); + final Consumer> stateSignatureTransaction); /** * Called by the platform after it has made all its changes to this state for the given round. diff --git a/platform-sdk/swirlds-platform-core/src/test/java/com/swirlds/platform/turtle/runner/TurtleTestingToolState.java b/platform-sdk/swirlds-platform-core/src/test/java/com/swirlds/platform/turtle/runner/TurtleTestingToolState.java index e1d23cd50e89..f4547d45a1cd 100644 --- a/platform-sdk/swirlds-platform-core/src/test/java/com/swirlds/platform/turtle/runner/TurtleTestingToolState.java +++ b/platform-sdk/swirlds-platform-core/src/test/java/com/swirlds/platform/turtle/runner/TurtleTestingToolState.java @@ -25,7 +25,6 @@ import com.swirlds.platform.system.BasicSoftwareVersion; import com.swirlds.platform.system.Round; import edu.umd.cs.findbugs.annotations.NonNull; -import java.util.List; import java.util.function.Consumer; /** @@ -84,9 +83,7 @@ public int getVersion() { public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { state = NonCryptographicHashing.hash64( state, round.getRoundNum(), diff --git a/platform-sdk/swirlds-platform-core/src/testFixtures/java/com/swirlds/platform/test/fixtures/state/BlockingSwirldState.java b/platform-sdk/swirlds-platform-core/src/testFixtures/java/com/swirlds/platform/test/fixtures/state/BlockingSwirldState.java index e5537a738c89..29b3ade2f864 100644 --- a/platform-sdk/swirlds-platform-core/src/testFixtures/java/com/swirlds/platform/test/fixtures/state/BlockingSwirldState.java +++ b/platform-sdk/swirlds-platform-core/src/testFixtures/java/com/swirlds/platform/test/fixtures/state/BlockingSwirldState.java @@ -36,7 +36,6 @@ import com.swirlds.state.merkle.singleton.StringLeaf; import edu.umd.cs.findbugs.annotations.NonNull; import java.io.IOException; -import java.util.List; import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.function.Consumer; @@ -86,9 +85,7 @@ private BlockingSwirldState(final BlockingSwirldState that) { public void handleConsensusRound( @NonNull final Round round, @NonNull final PlatformStateModifier platformState, - @NonNull - final Consumer>> - stateSignatureTransactions) { + @NonNull final Consumer> stateSignatureTransaction) { // intentionally does nothing }