From 00851d042c2ce48f1a99d265f7157cbec2fb1400 Mon Sep 17 00:00:00 2001 From: Sally MacFarlane Date: Thu, 7 Apr 2022 21:03:50 +1000 Subject: [PATCH] Not null annotations (#3708) * NotNull -> Nonnull Signed-off-by: Sally MacFarlane --- .../backup/BackupRoundTripAcceptanceTest.java | 9 +++------ ...ContractPermissioningStaticNodesAcceptanceTest.java | 4 ++-- .../acceptance/privacy/PrivCallAcceptanceTest.java | 6 +++--- .../multitenancy/MultiTenancyAcceptanceTest.java | 8 ++++---- .../ethereum/transaction/TransactionSimulator.java | 4 ++-- .../eth/sync/backwardsync/BackwardSyncContextTest.java | 6 +++--- .../backwardsync/BackwardSyncLookupServiceTest.java | 4 ++-- .../eth/sync/backwardsync/BackwardSyncPhaseTest.java | 6 +++--- .../eth/sync/backwardsync/BackwardSyncTaskTest.java | 10 ++++------ .../eth/sync/backwardsync/ChainForTestCreator.java | 4 ++-- .../eth/sync/backwardsync/ForwardSyncPhaseTest.java | 8 ++++---- .../connections/netty/NettyConnectionInitializer.java | 10 +++++----- .../NodeSmartContractV2PermissioningController.java | 4 ++-- ...ntegerModularExponentiationPrecompiledContract.java | 3 +-- .../besu/evm/precompile/SHA256PrecompiledContract.java | 3 +-- .../services/tasks/InMemoryTasksPriorityQueues.java | 5 ++--- .../enclave/testutil/TesseraTestHarnessFactory.java | 4 ++-- 17 files changed, 45 insertions(+), 53 deletions(-) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/backup/BackupRoundTripAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/backup/BackupRoundTripAcceptanceTest.java index ffbda11ed5..d2afc2e6d3 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/backup/BackupRoundTripAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/backup/BackupRoundTripAcceptanceTest.java @@ -37,9 +37,9 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.function.UnaryOperator; +import javax.annotation.Nonnull; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -139,10 +139,7 @@ public class BackupRoundTripAcceptanceTest extends AbstractPreexistingNodeTest { besu.createNode( "restore " + testName, configureNodeCommands( - restorePath, - "operator", - "x-restore-state", - "--backup-path=" + backupPath.toString())); + restorePath, "operator", "x-restore-state", "--backup-path=" + backupPath)); cluster.startNode(restoreNode); WaitUtils.waitFor(60, () -> restoreNode.verify(exitedSuccessfully)); @@ -185,7 +182,7 @@ public class BackupRoundTripAcceptanceTest extends AbstractPreexistingNodeTest { assertThat(rebackupManifest).isEqualTo(backupManifest); } - @NotNull + @Nonnull private UnaryOperator configureNodeCommands( final Path dataPath, final String... commands) { return nodeBuilder -> super.configureNode(nodeBuilder).dataPath(dataPath).run(commands); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodesSmartContractPermissioningStaticNodesAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodesSmartContractPermissioningStaticNodesAcceptanceTest.java index c4fe3ba0a5..57253d474c 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodesSmartContractPermissioningStaticNodesAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/permissioning/NodesSmartContractPermissioningStaticNodesAcceptanceTest.java @@ -22,8 +22,8 @@ import org.hyperledger.besu.tests.acceptance.dsl.node.RunnableNode; import java.net.URI; import java.util.Arrays; import java.util.List; +import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.junit.Test; @@ -72,7 +72,7 @@ public class NodesSmartContractPermissioningStaticNodesAcceptanceTest .build(); } - @NotNull + @Nonnull private List mapNodesToEnodeURLs(final List staticNodes) { return staticNodes.stream() .map(node -> (RunnableNode) node) diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/PrivCallAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/PrivCallAcceptanceTest.java index 1e9d116c0a..cf5adbb948 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/PrivCallAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/PrivCallAcceptanceTest.java @@ -30,8 +30,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Optional; +import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.Test; import org.web3j.abi.FunctionEncoder; import org.web3j.abi.TypeReference; @@ -191,7 +191,7 @@ public class PrivCallAcceptanceTest extends ParameterizedEnclaveTestBase { assertThat(result.getResult()).isEqualTo("0x"); } - @NotNull + @Nonnull private String constructInvalidString(final String privacyGroupId) { final char[] chars = privacyGroupId.toCharArray(); if (chars[3] == '0') { @@ -202,7 +202,7 @@ public class PrivCallAcceptanceTest extends ParameterizedEnclaveTestBase { return String.valueOf(chars); } - @NotNull + @Nonnull private Request privCall( final String privacyGroupId, final Contract eventEmitter, diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/MultiTenancyAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/MultiTenancyAcceptanceTest.java index fb5f1caa7a..e2fdd2188b 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/MultiTenancyAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/acceptance/privacy/multitenancy/MultiTenancyAcceptanceTest.java @@ -46,6 +46,7 @@ import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; +import javax.annotation.Nonnull; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -54,7 +55,6 @@ import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; -import org.jetbrains.annotations.NotNull; import org.junit.After; import org.junit.Before; import org.junit.Rule; @@ -256,7 +256,7 @@ public class MultiTenancyAcceptanceTest extends AcceptanceTestBase { final String privateFrom = validSignedPrivateTransaction.getPrivateFrom().toBase64String(); final String[] privateFor = validSignedPrivateTransaction.getPrivateFor().orElseThrow().stream() - .map(pf -> pf.toBase64String()) + .map(Bytes::toBase64String) .toArray(String[]::new); node.verify(priv.getEeaTransactionCount(accountAddress, privateFrom, privateFor, 0)); @@ -267,7 +267,7 @@ public class MultiTenancyAcceptanceTest extends AcceptanceTestBase { node.verify(priv.getEeaTransactionCount(accountAddress, privateFrom, privateFor, 1)); } - @NotNull + @Nonnull private Bytes32 getPrivacyGroupIdFromEeaTransaction( final PrivateTransaction validSignedPrivateTransaction) { return PrivacyGroupUtil.calculateEeaPrivacyGroupId( @@ -307,7 +307,7 @@ public class MultiTenancyAcceptanceTest extends AcceptanceTestBase { members.add(tx.getPrivateFrom().toBase64String()); members.addAll( tx.getPrivateFor().orElseThrow().stream() - .map(pf -> pf.toBase64String()) + .map(Bytes::toBase64String) .collect(Collectors.toList())); final String retrieveGroupResponse = mapper.writeValueAsString(testPrivacyGroupEea(members, PrivacyGroup.Type.LEGACY)); diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java index e5f80bcf7e..b74437f30a 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/TransactionSimulator.java @@ -43,11 +43,11 @@ import org.hyperledger.besu.evm.worldstate.WorldUpdater; import java.math.BigInteger; import java.util.Optional; +import javax.annotation.Nonnull; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import org.apache.tuweni.bytes.Bytes; -import org.jetbrains.annotations.NotNull; /* * Used to process transactions for eth_call and eth_estimateGas. @@ -161,7 +161,7 @@ public class TransactionSimulator { callParams, transactionValidationParams, operationTracer, header, updater); } - @NotNull + @Nonnull public Optional processWithWorldUpdater( final CallParameter callParams, final TransactionValidationParams transactionValidationParams, diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java index ae29abf692..ea8b96bce4 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncContextTest.java @@ -49,8 +49,8 @@ import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.concurrent.CompletableFuture; +import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -152,7 +152,7 @@ public class BackwardSyncContextTest { } @Test - public void shouldNotAppendWhenAlreadySyncingHash() throws Exception { + public void shouldNotAppendWhenAlreadySyncingHash() { final Hash hash = getBlockByNumber(REMOTE_HEIGHT).getHash(); when(backwardSyncLookupService.lookup(hash)) .thenReturn(CompletableFuture.completedFuture(Collections.emptyList())); @@ -213,7 +213,7 @@ public class BackwardSyncContextTest { peer.respondWhileOtherThreadsWork(responder, () -> !future.isDone()); } - @NotNull + @Nonnull private Block getBlockByNumber(final int number) { return remoteBlockchain.getBlockByNumber(number).orElseThrow(); } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncLookupServiceTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncLookupServiceTest.java index d25a717354..07b282a188 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncLookupServiceTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncLookupServiceTest.java @@ -41,8 +41,8 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.List; import java.util.concurrent.CompletableFuture; +import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -125,7 +125,7 @@ public class BackwardSyncLookupServiceTest { peer.respondWhileOtherThreadsWork(responder, () -> !future.isDone()); } - @NotNull + @Nonnull private Block getBlockByNumber(final int number) { return remoteBlockchain.getBlockByNumber(number).orElseThrow(); } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncPhaseTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncPhaseTest.java index f2a7efc8f1..db4682be76 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncPhaseTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncPhaseTest.java @@ -44,8 +44,8 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; +import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -278,13 +278,13 @@ public class BackwardSyncPhaseTest { return chain; } - @NotNull + @Nonnull private BackwardChain createBackwardChain(final int number) { return new BackwardChain( headersStorage, blocksStorage, remoteBlockchain.getBlockByNumber(number).orElseThrow()); } - @NotNull + @Nonnull private Block getBlockByNumber(final int number) { return remoteBlockchain.getBlockByNumber(number).orElseThrow(); } diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncTaskTest.java index 6eace4f04b..fb9514d766 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/BackwardSyncTaskTest.java @@ -27,9 +27,8 @@ import org.hyperledger.besu.services.kvstore.InMemoryKeyValueStorage; import java.util.List; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; +import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -73,14 +72,14 @@ public class BackwardSyncTaskTest { .hasMessageContaining("No pivot"); } - @NotNull + @Nonnull private BackwardSyncTask createBackwardSyncTask() { final BackwardChain backwardChain = new BackwardChain(headersStorage, blocksStorage, blocks.get(1)); return createBackwardSyncTask(backwardChain); } - @NotNull + @Nonnull private BackwardSyncTask createBackwardSyncTask(final BackwardChain backwardChain) { return new BackwardSyncTask(context, backwardChain) { @Override @@ -91,8 +90,7 @@ public class BackwardSyncTaskTest { } @Test - public void shouldFinishImmediatellyFailWhenPivotIsDifferent() - throws ExecutionException, InterruptedException { + public void shouldFinishImmediatelyFailWhenPivotIsDifferent() { final BackwardChain backwardChain = new BackwardChain(headersStorage, blocksStorage, blocks.get(0)); when(context.getCurrentChain()).thenReturn(Optional.of(backwardChain)); diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java index 3193d7c8d1..0b35018c59 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ChainForTestCreator.java @@ -28,9 +28,9 @@ import org.hyperledger.besu.evm.log.LogsBloomFilter; import java.util.ArrayList; import java.util.List; import java.util.Optional; +import javax.annotation.Nonnull; import org.apache.tuweni.bytes.Bytes; -import org.jetbrains.annotations.NotNull; public class ChainForTestCreator { @@ -105,7 +105,7 @@ public class ChainForTestCreator { return prepareHeader(number, Optional.empty()); } - @NotNull + @Nonnull private static BlockHeader prepareEmptyHeader(final BlockHeader parent) { return new BlockHeader( parent.getHash(), diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncPhaseTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncPhaseTest.java index 3f0c4031c4..c5f34d2a47 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncPhaseTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/backwardsync/ForwardSyncPhaseTest.java @@ -47,8 +47,8 @@ import org.hyperledger.besu.services.kvstore.InMemoryKeyValueStorage; import java.util.Collections; import java.util.List; import java.util.concurrent.CompletableFuture; +import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -240,7 +240,7 @@ public class ForwardSyncPhaseTest { } @Test - public void shouldAddSuccessorsWhenNoUnknownBlockSet() throws Exception { + public void shouldAddSuccessorsWhenNoUnknownBlockSet() { BackwardChain backwardChain = createBackwardChain(LOCAL_HEIGHT - 3, LOCAL_HEIGHT); backwardChain.appendExpectedBlock(getBlockByNumber(LOCAL_HEIGHT + 1)); backwardChain.appendExpectedBlock(getBlockByNumber(LOCAL_HEIGHT + 2)); @@ -263,13 +263,13 @@ public class ForwardSyncPhaseTest { return chain; } - @NotNull + @Nonnull private BackwardChain backwardChainFromBlock(final int number) { return new BackwardChain( headersStorage, blocksStorage, remoteBlockchain.getBlockByNumber(number).orElseThrow()); } - @NotNull + @Nonnull private Block getBlockByNumber(final int number) { return remoteBlockchain.getBlockByNumber(number).orElseThrow(); } diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/NettyConnectionInitializer.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/NettyConnectionInitializer.java index 7081d69909..17ff6a0539 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/NettyConnectionInitializer.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/NettyConnectionInitializer.java @@ -42,6 +42,7 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.IntSupplier; import java.util.stream.StreamSupport; +import javax.annotation.Nonnull; import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; @@ -55,7 +56,6 @@ import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.util.concurrent.SingleThreadEventExecutor; -import org.jetbrains.annotations.NotNull; public class NettyConnectionInitializer implements ConnectionInitializer, HandshakerProvider, FramerProvider { @@ -194,7 +194,7 @@ public class NettyConnectionInitializer } /** @return a channel initializer for outbound connections */ - @NotNull + @Nonnull private ChannelInitializer outboundChannelInitializer( final Peer peer, final CompletableFuture connectionFuture) { return new ChannelInitializer() { @@ -229,7 +229,7 @@ public class NettyConnectionInitializer }; } - @NotNull + @Nonnull private HandshakeHandlerInbound inboundHandler( final CompletableFuture connectionFuture) { return new HandshakeHandlerInbound( @@ -243,7 +243,7 @@ public class NettyConnectionInitializer this); } - @NotNull + @Nonnull private HandshakeHandlerOutbound outboundHandler( final Peer peer, final CompletableFuture connectionFuture) { return new HandshakeHandlerOutbound( @@ -258,7 +258,7 @@ public class NettyConnectionInitializer this); } - @NotNull + @Nonnull private TimeoutHandler timeoutHandler( final CompletableFuture connectionFuture, final String s) { return new TimeoutHandler<>( diff --git a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/NodeSmartContractV2PermissioningController.java b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/NodeSmartContractV2PermissioningController.java index 6977f20b8e..61d5c65b45 100644 --- a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/NodeSmartContractV2PermissioningController.java +++ b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/NodeSmartContractV2PermissioningController.java @@ -23,10 +23,10 @@ import org.hyperledger.besu.plugin.data.EnodeURL; import org.hyperledger.besu.plugin.services.MetricsSystem; import java.util.List; +import javax.annotation.Nonnull; import com.google.common.net.InetAddresses; import org.apache.tuweni.bytes.Bytes; -import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.web3j.abi.FunctionEncoder; @@ -75,7 +75,7 @@ public class NodeSmartContractV2PermissioningController } } - @NotNull + @Nonnull private Boolean getCallResult(final EnodeURL enode) { return transactionSimulator .processAtHead(buildCallParameters(createPayload(enode))) diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BigIntegerModularExponentiationPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BigIntegerModularExponentiationPrecompiledContract.java index 6d00c926a5..548bfc6b96 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BigIntegerModularExponentiationPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BigIntegerModularExponentiationPrecompiledContract.java @@ -23,7 +23,6 @@ import javax.annotation.Nonnull; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.MutableBytes; -import org.jetbrains.annotations.NotNull; // The big integer modular exponentiation precompiled contract defined in EIP-198. public class BigIntegerModularExponentiationPrecompiledContract @@ -53,7 +52,7 @@ public class BigIntegerModularExponentiationPrecompiledContract return gasCalculator().modExpGasCost(input); } - @NotNull + @Nonnull @Override public PrecompileContractResult computePrecompile( final Bytes input, @Nonnull final MessageFrame messageFrame) { diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/SHA256PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/SHA256PrecompiledContract.java index 384031f239..1b3ea52c64 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/SHA256PrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/SHA256PrecompiledContract.java @@ -21,7 +21,6 @@ import org.hyperledger.besu.evm.gascalculator.GasCalculator; import javax.annotation.Nonnull; import org.apache.tuweni.bytes.Bytes; -import org.jetbrains.annotations.NotNull; public class SHA256PrecompiledContract extends AbstractPrecompiledContract { @@ -34,7 +33,7 @@ public class SHA256PrecompiledContract extends AbstractPrecompiledContract { return gasCalculator().sha256PrecompiledContractGasCost(input); } - @NotNull + @Nonnull @Override public PrecompileContractResult computePrecompile( final Bytes input, @Nonnull final MessageFrame messageFrame) { diff --git a/services/tasks/src/main/java/org/hyperledger/besu/services/tasks/InMemoryTasksPriorityQueues.java b/services/tasks/src/main/java/org/hyperledger/besu/services/tasks/InMemoryTasksPriorityQueues.java index c09f743e90..43e03add62 100644 --- a/services/tasks/src/main/java/org/hyperledger/besu/services/tasks/InMemoryTasksPriorityQueues.java +++ b/services/tasks/src/main/java/org/hyperledger/besu/services/tasks/InMemoryTasksPriorityQueues.java @@ -22,8 +22,7 @@ import java.util.PriorityQueue; import java.util.Queue; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; - -import org.jetbrains.annotations.NotNull; +import javax.annotation.Nonnull; public class InMemoryTasksPriorityQueues implements TaskCollection { @@ -42,7 +41,7 @@ public class InMemoryTasksPriorityQueues } } - @NotNull + @Nonnull private PriorityQueue newEmptyQueue() { return new PriorityQueue<>(Comparator.comparingLong(TasksPriorityProvider::getPriority)); } diff --git a/testutil/src/main/java/org/hyperledger/enclave/testutil/TesseraTestHarnessFactory.java b/testutil/src/main/java/org/hyperledger/enclave/testutil/TesseraTestHarnessFactory.java index 3fd737756e..e5c7100e91 100644 --- a/testutil/src/main/java/org/hyperledger/enclave/testutil/TesseraTestHarnessFactory.java +++ b/testutil/src/main/java/org/hyperledger/enclave/testutil/TesseraTestHarnessFactory.java @@ -22,8 +22,8 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Optional; +import javax.annotation.Nonnull; -import org.jetbrains.annotations.NotNull; import org.testcontainers.containers.Network; public class TesseraTestHarnessFactory { @@ -68,7 +68,7 @@ public class TesseraTestHarnessFactory { containerNetwork); } - @NotNull + @Nonnull private static Path[] stringArrayToPathArray(final Path tempDir, final String[] privKeyPaths) { return Arrays.stream(privKeyPaths) .map(