Restore "FieldCanBeFinal" errorprone check (#287)

This was turned off a number of months ago because of long build times.
However it appears either because of code structure changes or fixed
errorprone that this finishes in a reasonable time now.

Code that violated this check is also fixed.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/289/head
Danno Ferrin 5 years ago committed by GitHub
parent dfad8bff78
commit e493b91742
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/blockchain/Amount.java
  2. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/condition/clique/ExpectedBlockHasProposer.java
  3. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/ethsigner/testutil/EthSignerConfig.java
  4. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/cluster/Cluster.java
  5. 6
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/configuration/BesuNodeConfigurationBuilder.java
  6. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/contract/LoadPrivateSmartContractTransaction.java
  7. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/FindPrivacyGroupTransaction.java
  8. 2
      acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/PrivDistributeTransactionTransaction.java
  9. 110
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/CrossContractReader.java
  10. 103
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/EventEmitter.java
  11. 93
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/RevertReason.java
  12. 95
      acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/SimpleStorage.java
  13. 2
      besu/src/main/java/org/hyperledger/besu/RunnerBuilder.java
  14. 21
      besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
  15. 2
      besu/src/main/java/org/hyperledger/besu/cli/subcommands/PasswordSubCommand.java
  16. 4
      besu/src/main/java/org/hyperledger/besu/cli/subcommands/PublicKeySubCommand.java
  17. 2
      besu/src/main/java/org/hyperledger/besu/cli/subcommands/RetestethSubCommand.java
  18. 2
      besu/src/main/java/org/hyperledger/besu/cli/subcommands/blocks/BlocksSubCommand.java
  19. 9
      besu/src/main/java/org/hyperledger/besu/cli/subcommands/operator/GenerateBlockchainConfig.java
  20. 6
      besu/src/main/java/org/hyperledger/besu/cli/subcommands/rlp/RLPSubCommand.java
  21. 2
      besu/src/main/java/org/hyperledger/besu/services/BesuEventsImpl.java
  22. 2
      besu/src/test/java/org/hyperledger/besu/cli/operator/OperatorSubCommandTest.java
  23. 3
      build.gradle
  24. 2
      consensus/common/src/main/java/org/hyperledger/besu/consensus/common/VoteTallyCache.java
  25. 2
      consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/StubbedSynchronizerUpdater.java
  26. 8
      consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContextBuilder.java
  27. 2
      consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/SpuriousBehaviourTest.java
  28. 2
      consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftProcessor.java
  29. 2
      consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinator.java
  30. 2
      consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/validation/MessageValidator.java
  31. 2
      consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/FutureMessageBufferTest.java
  32. 10
      consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/validation/MessageValidatorTest.java
  33. 2
      consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/validation/RoundChangeMessageValidatorTest.java
  34. 2
      crypto/src/main/java/org/hyperledger/besu/crypto/altbn128/AltBn128Fq2Point.java
  35. 2
      enclave/src/main/java/org/hyperledger/besu/enclave/EnclaveServerException.java
  36. 4
      enclave/src/main/java/org/hyperledger/besu/enclave/types/ReceiveRequest.java
  37. 4
      enclave/src/main/java/org/hyperledger/besu/enclave/types/SendRequest.java
  38. 2
      enclave/src/main/java/org/hyperledger/besu/enclave/types/SendRequestBesu.java
  39. 2
      enclave/src/main/java/org/hyperledger/besu/enclave/types/SendRequestLegacy.java
  40. 2
      enclave/src/main/java/org/hyperledger/besu/enclave/types/SendResponse.java
  41. 4
      ethereum/api/src/integration-test/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/PrivGetPrivateTransactionIntegrationTest.java
  42. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java
  43. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/TomlUser.java
  44. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/TraceTypeParameter.java
  45. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/MultiTenancyRpcMethodDecorator.java
  46. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/PrivacySendTransaction.java
  47. 6
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaSendRawTransaction.java
  48. 4
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivCreatePrivacyGroup.java
  49. 4
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivDeletePrivacyGroup.java
  50. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivDistributeRawTransaction.java
  51. 4
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivFindPrivacyGroup.java
  52. 4
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetEeaTransactionCount.java
  53. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetPrivateTransaction.java
  54. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionCount.java
  55. 6
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionReceipt.java
  56. 20
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/Action.java
  57. 12
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/FlatTrace.java
  58. 8
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/results/tracing/Result.java
  59. 2
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionLogsIndexer.java
  60. 2
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/AbstractJsonRpcHttpBySpecTest.java
  61. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/LatestNonceProviderTest.java
  62. 6
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/authentication/AuthenticationUtilsTest.java
  63. 3
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionCountTest.java
  64. 3
      ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionReceiptTest.java
  65. 2
      ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/AbstractBlockCreator.java
  66. 2
      ethereum/core/src/integration-test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/privacy/PrivacyPrecompiledContractIntegrationTest.java
  67. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/BlockAddedEvent.java
  68. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/DefaultEvmAccount.java
  69. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/privacy/storage/keyvalue/PrivacyKeyValueStorageProvider.java
  70. 4
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/Pruner.java
  71. 2
      ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/BlockDataGenerator.java
  72. 2
      ethereum/core/src/test-support/java/org/hyperledger/besu/ethereum/core/PrivateTransactionTestFixture.java
  73. 2
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/BLAKE2BFPrecompileContractTest.java
  74. 2
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/mainnet/precompiles/ECRECPrecompiledContractTest.java
  75. 2
      ethereum/core/src/test/java/org/hyperledger/besu/ethereum/proof/WorldStateProofProviderTest.java
  76. 2
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/DeterministicEthScheduler.java
  77. 4
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/MockEthTask.java
  78. 2
      ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/RespondingEthPeer.java
  79. 2
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/PeerDiscoveryController.java
  80. 2
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/DefaultP2PNetwork.java
  81. 2
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/permissions/PeerPermissionsBlacklist.java
  82. 2
      ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/discovery/internal/PeerDiscoveryControllerTest.java
  83. 2
      ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/peers/MaintainedPeersTest.java
  84. 2
      ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/AbstractPeerConnectionTest.java
  85. 5
      ethereum/p2p/src/test/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/MockConnectionInitializer.java
  86. 4
      ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfiguration.java
  87. 4
      ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/WhitelistPersistor.java
  88. 2
      ethereum/permissioning/src/test/java/org/hyperledger/besu/ethereum/permissioning/node/provider/SyncStatusNodePermissioningProviderTest.java
  89. 2
      metrics/core/src/main/java/org/hyperledger/besu/metrics/RunnableCounter.java
  90. 2
      plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/RocksDBKeyValueStorageFactory.java
  91. 2
      plugins/rocksdb/src/main/java/org/hyperledger/besu/plugin/services/storage/rocksdb/configuration/DatabaseMetadata.java
  92. 2
      util/src/main/java/org/hyperledger/besu/util/Subscribers.java
  93. 2
      util/src/main/java/org/hyperledger/besu/util/number/Fraction.java
  94. 2
      util/src/main/java/org/hyperledger/besu/util/number/Percentage.java
  95. 2
      util/src/main/java/org/hyperledger/besu/util/number/PositiveNumber.java

@ -25,8 +25,8 @@ import org.web3j.utils.Convert.Unit;
public class Amount {
private BigDecimal value;
private Unit unit;
private final BigDecimal value;
private final Unit unit;
private Amount(final BigDecimal value, final Unit unit) {
this.value = value;

@ -30,7 +30,7 @@ import org.web3j.protocol.core.methods.response.EthBlock.Block;
public class ExpectedBlockHasProposer implements Condition {
private final EthTransactions eth;
private Address proposer;
private final Address proposer;
public ExpectedBlockHasProposer(final EthTransactions eth, final Address proposer) {
this.eth = eth;

@ -25,7 +25,7 @@ public class EthSignerConfig implements Config {
private final Level logLevel;
private final String downstreamHttpHost;
private final Integer downStreamHttpPort;
private Duration downstreamHttpRequestTimeout;
private final Duration downstreamHttpRequestTimeout;
private final String httpListenHost;
private final Integer httpListenPort;
private final ChainIdProvider chainId;

@ -44,7 +44,7 @@ public class Cluster implements AutoCloseable {
private final NetConditions net;
private final ClusterConfiguration clusterConfiguration;
private List<? extends RunnableNode> originalNodes = emptyList();
private List<URI> bootnodes = new ArrayList<>();
private final List<URI> bootnodes = new ArrayList<>();
public Cluster(final NetConditions net) {
this(new ClusterConfigurationBuilder().build(), net, BesuNodeRunner.instance());

@ -47,12 +47,12 @@ public class BesuNodeConfigurationBuilder {
private boolean devMode = true;
private GenesisConfigurationProvider genesisConfigProvider = ignore -> Optional.empty();
private Boolean p2pEnabled = true;
private NetworkingConfiguration networkingConfiguration = NetworkingConfiguration.create();
private final NetworkingConfiguration networkingConfiguration = NetworkingConfiguration.create();
private boolean discoveryEnabled = true;
private boolean bootnodeEligible = true;
private boolean revertReasonEnabled = false;
private List<String> plugins = new ArrayList<>();
private List<String> extraCLIOptions = new ArrayList<>();
private final List<String> plugins = new ArrayList<>();
private final List<String> extraCLIOptions = new ArrayList<>();
private List<String> staticNodes = new ArrayList<>();
public BesuNodeConfigurationBuilder() {

@ -41,7 +41,7 @@ public class LoadPrivateSmartContractTransaction<T extends Contract> implements
private final long chainId;
private final Base64String privateFrom;
private final List<Base64String> privateFor;
private String contractAddress;
private final String contractAddress;
public LoadPrivateSmartContractTransaction(
final String contractAddress,

@ -26,7 +26,7 @@ import org.web3j.protocol.besu.response.privacy.PrivacyGroup;
import org.web3j.utils.Base64String;
public class FindPrivacyGroupTransaction implements Transaction<List<PrivacyGroup>> {
private List<Base64String> nodes;
private final List<Base64String> nodes;
public FindPrivacyGroupTransaction(final List<String> nodeEnclaveKeys) {

@ -20,7 +20,7 @@ import org.hyperledger.besu.tests.acceptance.dsl.transaction.Transaction;
import java.io.IOException;
public class PrivDistributeTransactionTransaction implements Transaction<String> {
private String signedPrivateTransaction;
private final String signedPrivateTransaction;
public PrivDistributeTransactionTransaction(final String signedPrivateTransaction) {
this.signedPrivateTransaction = signedPrivateTransaction;

@ -75,41 +75,41 @@ public class CrossContractReader extends Contract {
@Deprecated
protected CrossContractReader(
String contractAddress,
Web3j web3j,
Credentials credentials,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
}
protected CrossContractReader(
String contractAddress,
Web3j web3j,
Credentials credentials,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
@Deprecated
protected CrossContractReader(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
protected CrossContractReader(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
public RemoteFunctionCall<TransactionReceipt> remoteDestroy(String crossAddress) {
public RemoteFunctionCall<TransactionReceipt> remoteDestroy(final String crossAddress) {
final Function function =
new Function(
FUNC_REMOTEDESTROY,
@ -118,7 +118,7 @@ public class CrossContractReader extends Contract {
return executeRemoteCallTransaction(function);
}
public RemoteFunctionCall<TransactionReceipt> deployRemote(String crossAddress) {
public RemoteFunctionCall<TransactionReceipt> deployRemote(final String crossAddress) {
final Function function =
new Function(
FUNC_DEPLOYREMOTE,
@ -140,7 +140,7 @@ public class CrossContractReader extends Contract {
return executeRemoteCallTransaction(function);
}
public RemoteFunctionCall<BigInteger> read(String emitter_address) {
public RemoteFunctionCall<BigInteger> read(final String emitter_address) {
final Function function =
new Function(
FUNC_READ,
@ -156,7 +156,7 @@ public class CrossContractReader extends Contract {
return executeRemoteCallTransaction(function);
}
public RemoteFunctionCall<TransactionReceipt> incrementRemote(String crossAddress) {
public RemoteFunctionCall<TransactionReceipt> incrementRemote(final String crossAddress) {
final Function function =
new Function(
FUNC_INCREMENTREMOTE,
@ -166,7 +166,7 @@ public class CrossContractReader extends Contract {
}
public List<NewEventEmitterEventResponse> getNewEventEmitterEvents(
TransactionReceipt transactionReceipt) {
final TransactionReceipt transactionReceipt) {
List<Contract.EventValuesWithLog> valueList =
extractEventParametersWithLog(NEWEVENTEMITTER_EVENT, transactionReceipt);
ArrayList<NewEventEmitterEventResponse> responses =
@ -180,13 +180,14 @@ public class CrossContractReader extends Contract {
return responses;
}
public Flowable<NewEventEmitterEventResponse> newEventEmitterEventFlowable(EthFilter filter) {
public Flowable<NewEventEmitterEventResponse> newEventEmitterEventFlowable(
final EthFilter filter) {
return web3j
.ethLogFlowable(filter)
.map(
new io.reactivex.functions.Function<Log, NewEventEmitterEventResponse>() {
@Override
public NewEventEmitterEventResponse apply(Log log) {
public NewEventEmitterEventResponse apply(final Log log) {
Contract.EventValuesWithLog eventValues =
extractEventParametersWithLog(NEWEVENTEMITTER_EVENT, log);
NewEventEmitterEventResponse typedResponse = new NewEventEmitterEventResponse();
@ -199,7 +200,7 @@ public class CrossContractReader extends Contract {
}
public Flowable<NewEventEmitterEventResponse> newEventEmitterEventFlowable(
DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
final DefaultBlockParameter startBlock, final DefaultBlockParameter endBlock) {
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(NEWEVENTEMITTER_EVENT));
return newEventEmitterEventFlowable(filter);
@ -207,65 +208,72 @@ public class CrossContractReader extends Contract {
@Deprecated
public static CrossContractReader load(
String contractAddress,
Web3j web3j,
Credentials credentials,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return new CrossContractReader(contractAddress, web3j, credentials, gasPrice, gasLimit);
}
@Deprecated
public static CrossContractReader load(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return new CrossContractReader(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
public static CrossContractReader load(
String contractAddress,
Web3j web3j,
Credentials credentials,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
return new CrossContractReader(contractAddress, web3j, credentials, contractGasProvider);
}
public static CrossContractReader load(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
return new CrossContractReader(contractAddress, web3j, transactionManager, contractGasProvider);
}
public static RemoteCall<CrossContractReader> deploy(
Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
return deployRemoteCall(
CrossContractReader.class, web3j, credentials, contractGasProvider, BINARY, "");
}
@Deprecated
public static RemoteCall<CrossContractReader> deploy(
Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return deployRemoteCall(
CrossContractReader.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
}
public static RemoteCall<CrossContractReader> deploy(
Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
return deployRemoteCall(
CrossContractReader.class, web3j, transactionManager, contractGasProvider, BINARY, "");
}
@Deprecated
public static RemoteCall<CrossContractReader> deploy(
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return deployRemoteCall(
CrossContractReader.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
}

@ -71,37 +71,37 @@ public class EventEmitter extends Contract {
@Deprecated
protected EventEmitter(
String contractAddress,
Web3j web3j,
Credentials credentials,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
}
protected EventEmitter(
String contractAddress,
Web3j web3j,
Credentials credentials,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
@Deprecated
protected EventEmitter(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
protected EventEmitter(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
@ -114,7 +114,7 @@ public class EventEmitter extends Contract {
return executeRemoteCallSingleValueReturn(function, BigInteger.class);
}
public RemoteFunctionCall<TransactionReceipt> store(BigInteger _amount) {
public RemoteFunctionCall<TransactionReceipt> store(final BigInteger _amount) {
final Function function =
new Function(
FUNC_STORE,
@ -132,7 +132,7 @@ public class EventEmitter extends Contract {
return executeRemoteCallSingleValueReturn(function, String.class);
}
public List<StoredEventResponse> getStoredEvents(TransactionReceipt transactionReceipt) {
public List<StoredEventResponse> getStoredEvents(final TransactionReceipt transactionReceipt) {
List<Contract.EventValuesWithLog> valueList =
extractEventParametersWithLog(STORED_EVENT, transactionReceipt);
ArrayList<StoredEventResponse> responses = new ArrayList<StoredEventResponse>(valueList.size());
@ -146,13 +146,13 @@ public class EventEmitter extends Contract {
return responses;
}
public Flowable<StoredEventResponse> storedEventFlowable(EthFilter filter) {
public Flowable<StoredEventResponse> storedEventFlowable(final EthFilter filter) {
return web3j
.ethLogFlowable(filter)
.map(
new io.reactivex.functions.Function<Log, StoredEventResponse>() {
@Override
public StoredEventResponse apply(Log log) {
public StoredEventResponse apply(final Log log) {
Contract.EventValuesWithLog eventValues =
extractEventParametersWithLog(STORED_EVENT, log);
StoredEventResponse typedResponse = new StoredEventResponse();
@ -166,7 +166,7 @@ public class EventEmitter extends Contract {
}
public Flowable<StoredEventResponse> storedEventFlowable(
DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
final DefaultBlockParameter startBlock, final DefaultBlockParameter endBlock) {
EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
filter.addSingleTopic(EventEncoder.encode(STORED_EVENT));
return storedEventFlowable(filter);
@ -174,64 +174,71 @@ public class EventEmitter extends Contract {
@Deprecated
public static EventEmitter load(
String contractAddress,
Web3j web3j,
Credentials credentials,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return new EventEmitter(contractAddress, web3j, credentials, gasPrice, gasLimit);
}
@Deprecated
public static EventEmitter load(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return new EventEmitter(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
public static EventEmitter load(
String contractAddress,
Web3j web3j,
Credentials credentials,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
return new EventEmitter(contractAddress, web3j, credentials, contractGasProvider);
}
public static EventEmitter load(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
return new EventEmitter(contractAddress, web3j, transactionManager, contractGasProvider);
}
public static RemoteCall<EventEmitter> deploy(
Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
return deployRemoteCall(
EventEmitter.class, web3j, credentials, contractGasProvider, BINARY, "");
}
public static RemoteCall<EventEmitter> deploy(
Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
return deployRemoteCall(
EventEmitter.class, web3j, transactionManager, contractGasProvider, BINARY, "");
}
@Deprecated
public static RemoteCall<EventEmitter> deploy(
Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return deployRemoteCall(EventEmitter.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
}
@Deprecated
public static RemoteCall<EventEmitter> deploy(
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return deployRemoteCall(
EventEmitter.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
}

@ -50,37 +50,37 @@ public class RevertReason extends Contract {
@Deprecated
protected RevertReason(
String contractAddress,
Web3j web3j,
Credentials credentials,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
}
protected RevertReason(
String contractAddress,
Web3j web3j,
Credentials credentials,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
@Deprecated
protected RevertReason(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
protected RevertReason(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
@ -104,64 +104,71 @@ public class RevertReason extends Contract {
@Deprecated
public static RevertReason load(
String contractAddress,
Web3j web3j,
Credentials credentials,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return new RevertReason(contractAddress, web3j, credentials, gasPrice, gasLimit);
}
@Deprecated
public static RevertReason load(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return new RevertReason(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
public static RevertReason load(
String contractAddress,
Web3j web3j,
Credentials credentials,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
return new RevertReason(contractAddress, web3j, credentials, contractGasProvider);
}
public static RevertReason load(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
return new RevertReason(contractAddress, web3j, transactionManager, contractGasProvider);
}
public static RemoteCall<RevertReason> deploy(
Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
return deployRemoteCall(
RevertReason.class, web3j, credentials, contractGasProvider, BINARY, "");
}
@Deprecated
public static RemoteCall<RevertReason> deploy(
Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return deployRemoteCall(RevertReason.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
}
public static RemoteCall<RevertReason> deploy(
Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
return deployRemoteCall(
RevertReason.class, web3j, transactionManager, contractGasProvider, BINARY, "");
}
@Deprecated
public static RemoteCall<RevertReason> deploy(
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return deployRemoteCall(
RevertReason.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
}

@ -52,41 +52,41 @@ public class SimpleStorage extends Contract {
@Deprecated
protected SimpleStorage(
String contractAddress,
Web3j web3j,
Credentials credentials,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
}
protected SimpleStorage(
String contractAddress,
Web3j web3j,
Credentials credentials,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
@Deprecated
protected SimpleStorage(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
protected SimpleStorage(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
public RemoteCall<TransactionReceipt> set(BigInteger value) {
public RemoteCall<TransactionReceipt> set(final BigInteger value) {
final Function function =
new Function(
FUNC_SET,
@ -106,65 +106,72 @@ public class SimpleStorage extends Contract {
@Deprecated
public static SimpleStorage load(
String contractAddress,
Web3j web3j,
Credentials credentials,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return new SimpleStorage(contractAddress, web3j, credentials, gasPrice, gasLimit);
}
@Deprecated
public static SimpleStorage load(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return new SimpleStorage(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
}
public static SimpleStorage load(
String contractAddress,
Web3j web3j,
Credentials credentials,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
return new SimpleStorage(contractAddress, web3j, credentials, contractGasProvider);
}
public static SimpleStorage load(
String contractAddress,
Web3j web3j,
TransactionManager transactionManager,
ContractGasProvider contractGasProvider) {
final String contractAddress,
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
return new SimpleStorage(contractAddress, web3j, transactionManager, contractGasProvider);
}
public static RemoteCall<SimpleStorage> deploy(
Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
final Web3j web3j,
final Credentials credentials,
final ContractGasProvider contractGasProvider) {
return deployRemoteCall(
SimpleStorage.class, web3j, credentials, contractGasProvider, BINARY, "");
}
@Deprecated
public static RemoteCall<SimpleStorage> deploy(
Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
final Web3j web3j,
final Credentials credentials,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return deployRemoteCall(
SimpleStorage.class, web3j, credentials, gasPrice, gasLimit, BINARY, "");
}
public static RemoteCall<SimpleStorage> deploy(
Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
final Web3j web3j,
final TransactionManager transactionManager,
final ContractGasProvider contractGasProvider) {
return deployRemoteCall(
SimpleStorage.class, web3j, transactionManager, contractGasProvider, BINARY, "");
}
@Deprecated
public static RemoteCall<SimpleStorage> deploy(
Web3j web3j,
TransactionManager transactionManager,
BigInteger gasPrice,
BigInteger gasLimit) {
final Web3j web3j,
final TransactionManager transactionManager,
final BigInteger gasPrice,
final BigInteger gasLimit) {
return deployRemoteCall(
SimpleStorage.class, web3j, transactionManager, gasPrice, gasLimit, BINARY, "");
}

@ -113,7 +113,7 @@ public class RunnerBuilder {
private BesuController<?> besuController;
private NetworkingConfiguration networkingConfiguration = NetworkingConfiguration.create();
private Collection<Bytes> bannedNodeIds = new ArrayList<>();
private final Collection<Bytes> bannedNodeIds = new ArrayList<>();
private boolean p2pEnabled = true;
private boolean discovery;
private String p2pAdvertisedHost;

@ -339,7 +339,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
+ " (default: MAINNET)")
private final NetworkName network = null;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--p2p-host"},
paramLabel = MANDATORY_HOST_FORMAT_HELP,
@ -347,6 +347,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
arity = "1")
private String p2pHost = autoDiscoverDefaultIP().getHostAddress();
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--p2p-interface"},
paramLabel = MANDATORY_HOST_FORMAT_HELP,
@ -382,7 +383,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
description = "Set to start the GraphQL HTTP service (default: ${DEFAULT-VALUE})")
private final Boolean isGraphQLHttpEnabled = false;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--graphql-http-host"},
paramLabel = MANDATORY_HOST_FORMAT_HELP,
@ -408,7 +409,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
description = "Set to start the JSON-RPC HTTP service (default: ${DEFAULT-VALUE})")
private final Boolean isRpcHttpEnabled = false;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--rpc-http-host"},
paramLabel = MANDATORY_HOST_FORMAT_HELP,
@ -451,7 +452,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
description = "Set to start the JSON-RPC WebSocket service (default: ${DEFAULT-VALUE})")
private final Boolean isRpcWsEnabled = false;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--rpc-ws-host"},
paramLabel = MANDATORY_HOST_FORMAT_HELP,
@ -487,7 +488,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
description = "Set to start the metrics exporter (default: ${DEFAULT-VALUE})")
private final Boolean isMetricsEnabled = false;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--metrics-host"},
paramLabel = MANDATORY_HOST_FORMAT_HELP,
@ -516,7 +517,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
description = "Enable the metrics push gateway integration (default: ${DEFAULT-VALUE})")
private final Boolean isMetricsPushEnabled = false;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--metrics-push-host"},
paramLabel = MANDATORY_HOST_FORMAT_HELP,
@ -539,7 +540,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
arity = "1")
private final Integer metricsPushInterval = 15;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--metrics-push-prometheus-job"},
description = "Job name to use when in push mode (default: ${DEFAULT-VALUE})",
@ -571,7 +572,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
description = "Set if node will perform Stratum mining (default: ${DEFAULT-VALUE})")
private final Boolean iStratumMiningEnabled = false;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--miner-stratum-host"},
description = "Host for Stratum network mining service (default: ${DEFAULT-VALUE})")
@ -582,7 +583,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
description = "Stratum port binding (default: ${DEFAULT-VALUE})")
private final Integer stratumPort = 8008;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
hidden = true,
names = {"--Xminer-stratum-extranonce"},
@ -717,7 +718,7 @@ public class BesuCommand implements DefaultCommandValues, Runnable {
private final Integer pendingTxRetentionPeriod =
TransactionPoolConfiguration.DEFAULT_TX_RETENTION_HOURS;
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--key-value-storage"},
description = "Identity for the key-value storage to be used.",

@ -63,7 +63,7 @@ public class PasswordSubCommand implements Runnable {
mixinStandardHelpOptions = true)
static class HashSubCommand implements Runnable {
@SuppressWarnings("FieldMustBeFinal")
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = "--password",
arity = "1..1",

@ -103,7 +103,7 @@ public class PublicKeySubCommand implements Runnable {
paramLabel = DefaultCommandValues.MANDATORY_FILE_FORMAT_HELP,
description = "File to write public key to instead of standard output",
arity = "1..1")
private File publicKeyExportFile = null;
private final File publicKeyExportFile = null;
@SuppressWarnings("unused")
@ParentCommand
@ -155,7 +155,7 @@ public class PublicKeySubCommand implements Runnable {
paramLabel = DefaultCommandValues.MANDATORY_FILE_FORMAT_HELP,
description = "File to write address to instead of standard output",
arity = "1..1")
private File addressExportFile = null;
private final File addressExportFile = null;
@SuppressWarnings("unused")
@ParentCommand

@ -64,7 +64,7 @@ public class RetestethSubCommand implements Runnable {
"Logging verbosity levels: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE, ALL (default: ${DEFAULT-VALUE})")
private final Level logLevel = LogManager.getRootLogger().getLevel();
@SuppressWarnings("FieldMayBeFinal") // Because PicoCLI requires Strings to not be final.
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = {"--rpc-http-host"},
paramLabel = DefaultCommandValues.MANDATORY_HOST_FORMAT_HELP,

@ -253,7 +253,7 @@ public class BlocksSubCommand implements Runnable {
paramLabel = DefaultCommandValues.MANDATORY_FILE_FORMAT_HELP,
description = "File to write the block list to.",
arity = "1..1")
private File blocksExportFile = null;
private final File blocksExportFile = null;
@SuppressWarnings("unused")
@Spec

@ -60,7 +60,7 @@ class GenerateBlockchainConfig implements Runnable {
paramLabel = DefaultCommandValues.MANDATORY_FILE_FORMAT_HELP,
description = "Configuration file.",
arity = "1..1")
private File configurationFile = null;
private final File configurationFile = null;
@Option(
required = true,
@ -68,8 +68,9 @@ class GenerateBlockchainConfig implements Runnable {
paramLabel = DefaultCommandValues.MANDATORY_DIRECTORY_FORMAT_HELP,
description = "Directory to write output files to.",
arity = "1..1")
private File outputDirectory = null;
private final File outputDirectory = null;
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = "--genesis-file-name",
paramLabel = DefaultCommandValues.MANDATORY_PATH_FORMAT_HELP,
@ -77,6 +78,7 @@ class GenerateBlockchainConfig implements Runnable {
arity = "1..1")
private String genesisFileName = "genesis.json";
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = "--private-key-file-name",
paramLabel = DefaultCommandValues.MANDATORY_PATH_FORMAT_HELP,
@ -84,6 +86,7 @@ class GenerateBlockchainConfig implements Runnable {
arity = "1..1")
private String privateKeyFileName = "key.priv";
@SuppressWarnings({"FieldCanBeFinal", "FieldMayBeFinal"}) // PicoCLI requires non-final Strings.
@Option(
names = "--public-key-file-name",
paramLabel = DefaultCommandValues.MANDATORY_PATH_FORMAT_HELP,
@ -99,7 +102,7 @@ class GenerateBlockchainConfig implements Runnable {
private ObjectNode blockchainConfig;
private ObjectNode nodesConfig;
private boolean generateNodesKeys;
private List<Address> addressesForGenesisExtraData = new ArrayList<>();
private final List<Address> addressesForGenesisExtraData = new ArrayList<>();
private Path keysDirectory;
@Override

@ -95,21 +95,21 @@ public class RLPSubCommand implements Runnable {
description =
"Type of the RLP data to encode, possible values are ${COMPLETION-CANDIDATES}. (default: ${DEFAULT-VALUE})",
arity = "1..1")
private RLPType type = RLPType.IBFT_EXTRA_DATA;
private final RLPType type = RLPType.IBFT_EXTRA_DATA;
@Option(
names = "--from",
paramLabel = DefaultCommandValues.MANDATORY_FILE_FORMAT_HELP,
description = "File containing JSON object to encode",
arity = "1..1")
private File jsonSourceFile = null;
private final File jsonSourceFile = null;
@Option(
names = "--to",
paramLabel = DefaultCommandValues.MANDATORY_FILE_FORMAT_HELP,
description = "File to write encoded RLP string to.",
arity = "1..1")
private File rlpTargetFile = null;
private final File rlpTargetFile = null;
@Override
public void run() {

@ -38,7 +38,7 @@ import java.util.function.Supplier;
import org.apache.tuweni.bytes.Bytes;
public class BesuEventsImpl implements BesuEvents {
private Blockchain blockchain;
private final Blockchain blockchain;
private final BlockBroadcaster blockBroadcaster;
private final TransactionPool transactionPool;
private final SyncState syncState;

@ -245,7 +245,7 @@ public class OperatorSubCommandTest extends CommandTestAbstract {
}
static class Cmd {
private List<String> args;
private final List<String> args;
private Cmd(final List<String> args) {
this.args = args;

@ -189,8 +189,6 @@ allprojects {
check('ImmutableEnumChecker', CheckSeverity.OFF)
// This is a style check instead of an error-prone pattern.
check('UnnecessaryParentheses', CheckSeverity.OFF)
// Lazy impl causes excess CPU usage O(n) of non-final fiield when it should be O(1).
check('FieldCanBeFinal', CheckSeverity.OFF)
// This check is broken in Java 12. See https://github.com/google/error-prone/issues/1257
if (JavaVersion.current() == JavaVersion.VERSION_12) {
@ -201,6 +199,7 @@ allprojects {
check('TypeParameterUnusedInFormals', CheckSeverity.OFF)
}
check('FieldCanBeFinal', CheckSeverity.WARN)
check('InsecureCryptoUsage', CheckSeverity.WARN)
check('WildcardImport', CheckSeverity.WARN)
}

@ -36,7 +36,7 @@ public class VoteTallyCache {
private final Cache<Hash, VoteTally> voteTallyCache =
CacheBuilder.newBuilder().maximumSize(100).build();
private BlockInterface blockInterface;
private final BlockInterface blockInterface;
public VoteTallyCache(
final Blockchain blockchain,

@ -26,7 +26,7 @@ import java.util.stream.Collectors;
public class StubbedSynchronizerUpdater implements SynchronizerUpdater {
private Map<PeerConnection, ValidatorPeer> validatorNodes = new HashMap<>();
private final Map<PeerConnection, ValidatorPeer> validatorNodes = new HashMap<>();
@Override
public void updatePeerChainState(

@ -89,14 +89,14 @@ import org.apache.tuweni.bytes.Bytes;
public class TestContextBuilder {
private static MetricsSystem metricsSystem = new NoOpMetricsSystem();
private static final MetricsSystem metricsSystem = new NoOpMetricsSystem();
private static class ControllerAndState {
private final IbftExecutors ibftExecutors;
private IbftController controller;
private IbftFinalState finalState;
private EventMultiplexer eventMultiplexer;
private final IbftController controller;
private final IbftFinalState finalState;
private final EventMultiplexer eventMultiplexer;
public ControllerAndState(
final IbftExecutors ibftExecutors,

@ -63,7 +63,7 @@ public class SpuriousBehaviourTest {
private final ConsensusRoundIdentifier roundId = new ConsensusRoundIdentifier(1, 0);
private final RoundSpecificPeers peers = context.roundSpecificPeers(roundId);
private Block proposedBlock = context.createBlockForProposalFromChainHead(0, 30);
private final Block proposedBlock = context.createBlockForProposalFromChainHead(0, 30);
private Prepare expectedPrepare;
private Commit expectedCommit;

@ -31,7 +31,7 @@ public class IbftProcessor implements Runnable {
private final IbftEventQueue incomingQueue;
private volatile boolean shutdown = false;
private final EventMultiplexer eventMultiplexer;
private CountDownLatch shutdownLatch = new CountDownLatch(1);
private final CountDownLatch shutdownLatch = new CountDownLatch(1);
/**
* Construct a new IbftProcessor

@ -56,7 +56,7 @@ public class IbftMiningCoordinator implements MiningCoordinator, BlockAddedObser
private final IbftExecutors ibftExecutors;
private long blockAddedObserverId;
private AtomicReference<State> state = new AtomicReference<>(State.IDLE);
private final AtomicReference<State> state = new AtomicReference<>(State.IDLE);
public IbftMiningCoordinator(
final IbftExecutors ibftExecutors,

@ -39,7 +39,7 @@ public class MessageValidator {
private final ProposalBlockConsistencyValidator proposalConsistencyValidator;
private final BlockValidator<IbftContext> blockValidator;
private final ProtocolContext<IbftContext> protocolContext;
private RoundChangeCertificateValidator roundChangeCertificateValidator;
private final RoundChangeCertificateValidator roundChangeCertificateValidator;
public MessageValidator(
final SignedDataValidator signedDataValidator,

@ -36,7 +36,7 @@ import org.junit.Test;
public class FutureMessageBufferTest {
private Message message;
private FutureMessageBuffer futureMsgBuffer;
private PeerConnection peerConnection = MockPeerFactory.create(AddressHelpers.ofValue(9));
private final PeerConnection peerConnection = MockPeerFactory.create(AddressHelpers.ofValue(9));
@Before
public void setup() {

@ -55,12 +55,12 @@ import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class MessageValidatorTest {
private KeyPair keyPair = KeyPair.generate();
private MessageFactory messageFactory = new MessageFactory(keyPair);
private ConsensusRoundIdentifier roundIdentifier = new ConsensusRoundIdentifier(1, 0);
private final KeyPair keyPair = KeyPair.generate();
private final MessageFactory messageFactory = new MessageFactory(keyPair);
private final ConsensusRoundIdentifier roundIdentifier = new ConsensusRoundIdentifier(1, 0);
private SignedDataValidator signedDataValidator = mock(SignedDataValidator.class);
private ProposalBlockConsistencyValidator proposalBlockConsistencyValidator =
private final SignedDataValidator signedDataValidator = mock(SignedDataValidator.class);
private final ProposalBlockConsistencyValidator proposalBlockConsistencyValidator =
mock(ProposalBlockConsistencyValidator.class);
@Mock private BlockValidator<IbftContext> blockValidator;

@ -34,7 +34,7 @@ public class RoundChangeMessageValidatorTest {
private final MessageFactory messageFactory = new MessageFactory(keyPair);
private final ConsensusRoundIdentifier roundIdentifier = new ConsensusRoundIdentifier(1, 1);
private ProposalBlockConsistencyValidator proposalBlockConsistencyValidator =
private final ProposalBlockConsistencyValidator proposalBlockConsistencyValidator =
mock(ProposalBlockConsistencyValidator.class);
private final RoundChangeMessageValidator validator =

@ -21,7 +21,7 @@ import java.math.BigInteger;
* https://github.com/ethereum/py_ecc/blob/master/py_ecc/bn128/bn128_field_elements.py
*/
public class AltBn128Fq2Point extends AbstractFieldPoint<AltBn128Fq2Point> {
private static BigInteger CURVE_ORDER =
private static final BigInteger CURVE_ORDER =
new BigInteger(
"21888242871839275222246405745257275088548364400416034343698204186575808495617", 10);

@ -15,7 +15,7 @@
package org.hyperledger.besu.enclave;
public class EnclaveServerException extends RuntimeException {
private int statusCode;
private final int statusCode;
public EnclaveServerException(final int statusCode, final String message) {
super(message);

@ -19,8 +19,8 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonPropertyOrder({"key", "to"})
public class ReceiveRequest {
private String key;
private String to;
private final String key;
private final String to;
public ReceiveRequest(
@JsonProperty(value = "key") final String key, @JsonProperty(value = "to") final String to) {

@ -17,8 +17,8 @@ package org.hyperledger.besu.enclave.types;
import static java.nio.charset.StandardCharsets.UTF_8;
public abstract class SendRequest {
private byte[] payload;
private String from;
private final byte[] payload;
private final String from;
public SendRequest(final String payload, final String from) {
this.payload = payload.getBytes(UTF_8);

@ -19,7 +19,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonPropertyOrder({"payload", "from", "privacyGroupId"})
public class SendRequestBesu extends SendRequest {
private String privacyGroupId;
private final String privacyGroupId;
public SendRequestBesu(
@JsonProperty(value = "payload") final String payload,

@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonPropertyOrder({"payload", "from", "to"})
public class SendRequestLegacy extends SendRequest {
private List<String> to;
private final List<String> to;
public SendRequestLegacy(
@JsonProperty(value = "payload") final String payload,

@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonPropertyOrder({"key"})
public class SendResponse {
private String key;
private final String key;
@JsonCreator
public SendResponse(@JsonProperty("key") final String key) {

@ -75,9 +75,9 @@ public class PrivGetPrivateTransactionIntegrationTest {
private final Transaction justTransaction = mock(Transaction.class);
private static Vertx vertx = Vertx.vertx();
private static final Vertx vertx = Vertx.vertx();
private EnclavePublicKeyProvider enclavePublicKeyProvider = (user) -> ENCLAVE_PUBLIC_KEY;
private final EnclavePublicKeyProvider enclavePublicKeyProvider = (user) -> ENCLAVE_PUBLIC_KEY;
@BeforeClass
public static void setUpOnce() throws Exception {

@ -118,7 +118,7 @@ public enum RpcMethod {
private final String methodName;
private static Collection<String> allMethodNames;
private static final Collection<String> allMethodNames;
public String getMethodName() {
return methodName;

@ -30,7 +30,7 @@ public class TomlUser extends AbstractUser {
private final List<String> groups;
private final List<String> permissions;
private final List<String> roles;
private Optional<String> privacyPublicKey;
private final Optional<String> privacyPublicKey;
TomlUser(
final String username,

@ -47,7 +47,7 @@ public class TraceTypeParameter {
}
}
private Set<TraceType> traceTypes;
private final Set<TraceType> traceTypes;
@JsonCreator
public TraceTypeParameter(final List<String> traceTypesInput) {

@ -29,7 +29,7 @@ import org.apache.logging.log4j.Logger;
public class MultiTenancyRpcMethodDecorator implements JsonRpcMethod {
private static final Logger LOG = getLogger();
private JsonRpcMethod rpcMethod;
private final JsonRpcMethod rpcMethod;
public MultiTenancyRpcMethodDecorator(final JsonRpcMethod rpcMethod) {
this.rpcMethod = rpcMethod;

@ -37,7 +37,7 @@ public class PrivacySendTransaction {
private static final Logger LOG = LogManager.getLogger();
protected final PrivacyController privacyController;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivacySendTransaction(
final PrivacyController privacyController,

@ -34,9 +34,9 @@ import org.hyperledger.besu.ethereum.privacy.SendTransactionResponse;
public class EeaSendRawTransaction implements JsonRpcMethod {
private final PrivacySendTransaction privacySendTransaction;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private TransactionPool transactionPool;
private PrivacyController privacyController;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
private final TransactionPool transactionPool;
private final PrivacyController privacyController;
public EeaSendRawTransaction(
final TransactionPool transactionPool,

@ -33,8 +33,8 @@ import org.apache.logging.log4j.Logger;
public class PrivCreatePrivacyGroup implements JsonRpcMethod {
private static final Logger LOG = getLogger();
private PrivacyController privacyController;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final PrivacyController privacyController;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivCreatePrivacyGroup(
final PrivacyController privacyController,

@ -31,8 +31,8 @@ import org.apache.logging.log4j.Logger;
public class PrivDeletePrivacyGroup implements JsonRpcMethod {
private static final Logger LOG = getLogger();
private PrivacyController privacyController;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final PrivacyController privacyController;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivDeletePrivacyGroup(
final PrivacyController privacyController,

@ -36,7 +36,7 @@ public class PrivDistributeRawTransaction implements JsonRpcMethod {
private final PrivacyController privacyController;
private final PrivacySendTransaction privacySendTransaction;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivDistributeRawTransaction(
final PrivacyController privacyController,

@ -34,8 +34,8 @@ import org.apache.logging.log4j.Logger;
public class PrivFindPrivacyGroup implements JsonRpcMethod {
private static final Logger LOG = getLogger();
private PrivacyController privacyController;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final PrivacyController privacyController;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivFindPrivacyGroup(
final PrivacyController privacyController,

@ -34,8 +34,8 @@ public class PrivGetEeaTransactionCount implements JsonRpcMethod {
private static final Logger LOG = getLogger();
private PrivacyController privacyController;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final PrivacyController privacyController;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivGetEeaTransactionCount(
final PrivacyController privacyController,

@ -42,7 +42,7 @@ public class PrivGetPrivateTransaction implements JsonRpcMethod {
private final BlockchainQueries blockchain;
private final PrivacyController privacyController;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivGetPrivateTransaction(
final BlockchainQueries blockchain,

@ -29,7 +29,7 @@ import org.hyperledger.besu.ethereum.privacy.PrivacyController;
public class PrivGetTransactionCount implements JsonRpcMethod {
private final PrivacyController privacyController;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivGetTransactionCount(
final PrivacyController privacyController,

@ -55,9 +55,9 @@ public class PrivGetTransactionReceipt implements JsonRpcMethod {
private static final Logger LOG = getLogger();
private final BlockchainQueries blockchain;
private PrivacyParameters privacyParameters;
private PrivacyController privacyController;
private EnclavePublicKeyProvider enclavePublicKeyProvider;
private final PrivacyParameters privacyParameters;
private final PrivacyController privacyController;
private final EnclavePublicKeyProvider enclavePublicKeyProvider;
public PrivGetTransactionReceipt(
final BlockchainQueries blockchain,

@ -35,16 +35,16 @@ import org.apache.tuweni.bytes.Bytes32;
@JsonInclude(NON_NULL)
public class Action {
private String callType;
private String from;
private String gas;
private String input;
private String to;
private String init;
private String value;
private String address;
private String balance;
private String refundAddress;
private final String callType;
private final String from;
private final String gas;
private final String input;
private final String to;
private final String init;
private final String value;
private final String address;
private final String balance;
private final String refundAddress;
private Action(
final String callType,

@ -20,11 +20,11 @@ import java.util.ArrayList;
import java.util.List;
public class FlatTrace implements Trace {
private Action action;
private Result result;
private int subtraces;
private List<Integer> traceAddress;
private String type;
private final Action action;
private final Result result;
private final int subtraces;
private final List<Integer> traceAddress;
private final String type;
private FlatTrace(
final Action.Builder actionBuilder,
@ -85,7 +85,7 @@ public class FlatTrace implements Trace {
public static class Context {
private Builder builder;
private final Builder builder;
private boolean returned;
private boolean isSubtrace = false;

@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonInclude;
@JsonInclude(NON_NULL)
public class Result {
private String gasUsed;
private String output;
private String code;
private final String gasUsed;
private final String output;
private final String code;
public Result(
final String gasUsed, final String output, final String code, final String address) {
@ -32,7 +32,7 @@ public class Result {
this.address = address;
}
private String address;
private final String address;
public String getGasUsed() {
return gasUsed;

@ -51,7 +51,7 @@ public class TransactionLogsIndexer {
private final Blockchain blockchain;
private final Path cacheDir;
private IndexingStatus indexingStatus = new IndexingStatus();
private final IndexingStatus indexingStatus = new IndexingStatus();
public TransactionLogsIndexer(
final Blockchain blockchain, final Path cacheDir, final EthScheduler scheduler) {

@ -43,7 +43,7 @@ import org.junit.runners.Parameterized;
@RunWith(Parameterized.class)
public abstract class AbstractJsonRpcHttpBySpecTest extends AbstractJsonRpcHttpServiceTest {
private static ObjectMapper objectMapper = new ObjectMapper();
private static final ObjectMapper objectMapper = new ObjectMapper();
private final URL specURL;
public AbstractJsonRpcHttpBySpecTest(final String specName, final URL specURL) {

@ -30,9 +30,9 @@ public class LatestNonceProviderTest {
private final Address senderAdress = Address.fromHexString("1");
private PendingTransactions pendingTransactions = mock(PendingTransactions.class);
private BlockchainQueries blockchainQueries = mock(BlockchainQueries.class);
private LatestNonceProvider nonceProvider =
private final PendingTransactions pendingTransactions = mock(PendingTransactions.class);
private final BlockchainQueries blockchainQueries = mock(BlockchainQueries.class);
private final LatestNonceProvider nonceProvider =
new LatestNonceProvider(blockchainQueries, pendingTransactions);
@Test

@ -30,13 +30,13 @@ import org.junit.Test;
public class AuthenticationUtilsTest {
private static String INVALID_TOKEN_WITHOUT_EXP =
private static final String INVALID_TOKEN_WITHOUT_EXP =
"ewogICJhbGciOiAibm9uZSIsCiAgInR5cCI6ICJKV1QiCn"
+ "0.eyJpYXQiOjE1MTYyMzkwMjIsInBlcm1pc3Npb25zIjpbIm5ldDpwZWVyQ291bnQiXX0";
private static String VALID_TOKEN =
private static final String VALID_TOKEN =
"ewogICJhbGciOiAibm9uZSIsCiAgInR5cCI6ICJKV1QiCn0.eyJpYXQiOjE1"
+ "MTYyMzkwMjIsImV4cCI6NDcyOTM2MzIwMCwicGVybWlzc2lvbnMiOlsibmV0OnBlZXJDb3VudCJdfQ";
private static String VALID_TOKEN_DECODED_PAYLOAD =
private static final String VALID_TOKEN_DECODED_PAYLOAD =
"{\"iat\": 1516239022,\"exp\": 4729363200," + "\"permissions\": [\"net:peerCount\"]}";
@Test

@ -46,7 +46,8 @@ public class PrivGetTransactionCountTest {
private final Address senderAddress =
Address.fromHexString("0x627306090abab3a6e1400e9345bc60c78a8bef57");
private final long NONCE = 5;
private User user = new JWTUser(new JsonObject().put("privacyPublicKey", ENCLAVE_PUBLIC_KEY), "");
private final User user =
new JWTUser(new JsonObject().put("privacyPublicKey", ENCLAVE_PUBLIC_KEY), "");
private final EnclavePublicKeyProvider enclavePublicKeyProvider = (user) -> ENCLAVE_PUBLIC_KEY;
@Before

@ -142,7 +142,8 @@ public class PrivGetTransactionReceiptTest {
null,
Quantity.create(Bytes.of(1).toUnsignedBigInteger()));
private User user = new JWTUser(new JsonObject().put("privacyPublicKey", ENCLAVE_PUBLIC_KEY), "");
private final User user =
new JWTUser(new JsonObject().put("privacyPublicKey", ENCLAVE_PUBLIC_KEY), "");
private final EnclavePublicKeyProvider enclavePublicKeyProvider = (user) -> ENCLAVE_PUBLIC_KEY;
private final BlockchainQueries blockchainQueries = mock(BlockchainQueries.class);

@ -285,7 +285,7 @@ public abstract class AbstractBlockCreator<C> implements AsyncBlockCreator {
final ProcessableBlockHeader header,
final List<BlockHeader> ommers,
final Wei blockReward,
boolean skipZeroBlockRewards) {
final boolean skipZeroBlockRewards) {
// TODO(tmm): Added to make this work, should come from blockProcessor.
final int MAX_GENERATION = 6;

@ -83,7 +83,7 @@ public class PrivacyPrecompiledContractIntegrationTest {
private static OrionTestHarness testHarness;
private static WorldStateArchive worldStateArchive;
private static PrivateStateStorage privateStateStorage;
private static Vertx vertx = Vertx.vertx();
private static final Vertx vertx = Vertx.vertx();
private PrivateTransactionProcessor mockPrivateTxProcessor() {
final PrivateTransactionProcessor mockPrivateTransactionProcessor =

@ -27,7 +27,7 @@ public class BlockAddedEvent {
private final List<Transaction> addedTransactions;
private final List<Transaction> removedTransactions;
private final EventType eventType;
private List<LogWithMetadata> logsWithMetadata;
private final List<LogWithMetadata> logsWithMetadata;
public enum EventType {
HEAD_ADVANCED,

@ -21,7 +21,7 @@ import org.apache.tuweni.bytes.Bytes32;
import org.apache.tuweni.units.bigints.UInt256;
public class DefaultEvmAccount implements EvmAccount {
private MutableAccount mutableAccount;
private final MutableAccount mutableAccount;
public boolean isImmutable() {
return isImmutable;

@ -31,7 +31,7 @@ public class PrivacyKeyValueStorageProvider implements PrivacyStorageProvider {
private final KeyValueStorage privateWorldStatePreimageStorage;
private final KeyValueStorage privateStateStorage;
private int factoryVersion;
private final int factoryVersion;
public PrivacyKeyValueStorageProvider(
final KeyValueStorage privateWorldStateStorage,

@ -44,9 +44,9 @@ public class Pruner {
new AtomicReference<>(PruningPhase.IDLE);
private volatile long markBlockNumber = 0;
private volatile BlockHeader markedBlockHeader;
private long blockConfirmations;
private final long blockConfirmations;
private AtomicReference<State> state = new AtomicReference<>(State.IDLE);
private final AtomicReference<State> state = new AtomicReference<>(State.IDLE);
private final Supplier<ExecutorService> executorServiceSupplier;
private ExecutorService executorService;

@ -487,7 +487,7 @@ public class BlockDataGenerator {
private Optional<Hash> parentHash = Optional.empty();
private Optional<Hash> stateRoot = Optional.empty();
private Optional<Difficulty> difficulty = Optional.empty();
private List<Transaction> transactions = new ArrayList<>();
private final List<Transaction> transactions = new ArrayList<>();
private Optional<Bytes> extraData = Optional.empty();
private Optional<BlockHeaderFunctions> blockHeaderFunctions = Optional.empty();

@ -52,7 +52,7 @@ public class PrivateTransactionTestFixture {
private Optional<Bytes> privacyGroupId = Optional.empty();
private Restriction restriction = Restriction.RESTRICTED;
private final Restriction restriction = Restriction.RESTRICTED;
public PrivateTransaction createTransaction(final KeyPair keys) {
final PrivateTransaction.Builder builder = PrivateTransaction.builder();

@ -33,7 +33,7 @@ public class BLAKE2BFPrecompileContractTest {
public BLAKE2BFPrecompileContractTest() {}
private MessageFrame messageFrame = mock(MessageFrame.class);
private final MessageFrame messageFrame = mock(MessageFrame.class);
@Parameterized.Parameters
public static Object[][] parameters() {

@ -36,7 +36,7 @@ public class ECRECPrecompiledContractTest {
public ECRECPrecompiledContractTest() {}
private MessageFrame messageFrame = mock(MessageFrame.class);
private final MessageFrame messageFrame = mock(MessageFrame.class);
@Parameters
public static Object[][] parameters() {

@ -47,7 +47,7 @@ public class WorldStateProofProviderTest {
private static final Address address =
Address.fromHexString("0x1234567890123456789012345678901234567890");
private WorldStateStorage worldStateStorage =
private final WorldStateStorage worldStateStorage =
new WorldStateKeyValueStorage(new InMemoryKeyValueStorage());
private WorldStateProofProvider worldStateProofProvider;

@ -30,7 +30,7 @@ public class DeterministicEthScheduler extends EthScheduler {
private final TimeoutPolicy timeoutPolicy;
private final List<MockExecutorService> executors;
private List<PendingTimeout<?>> pendingTimeouts = new ArrayList<>();
private final List<PendingTimeout<?>> pendingTimeouts = new ArrayList<>();
public DeterministicEthScheduler() {
this(TimeoutPolicy.NEVER_TIMEOUT);

@ -21,8 +21,8 @@ import java.util.concurrent.CountDownLatch;
public class MockEthTask extends AbstractEthTask<Object> {
private CountDownLatch startedLatch = new CountDownLatch(1);
private CountDownLatch countdown;
private final CountDownLatch startedLatch = new CountDownLatch(1);
private final CountDownLatch countdown;
MockEthTask(final int count) {
super(new NoOpMetricsSystem());

@ -341,7 +341,7 @@ public class RespondingEthPeer {
private Hash chainHeadHash = gen.hash();
private Difficulty totalDifficulty = Difficulty.of(1000L);
private OptionalLong estimatedHeight = OptionalLong.of(1000L);
private List<PeerValidator> peerValidators = new ArrayList<>();
private final List<PeerValidator> peerValidators = new ArrayList<>();
public RespondingEthPeer build() {
checkNotNull(ethProtocolManager, "Must configure EthProtocolManager");

@ -655,7 +655,7 @@ public class PeerDiscoveryController {
private PeerPermissions peerPermissions = PeerPermissions.noop();
private long tableRefreshIntervalMs = MILLISECONDS.convert(30, TimeUnit.MINUTES);
private long cleanPeerTableIntervalMs = MILLISECONDS.convert(1, TimeUnit.MINUTES);
private List<DiscoveryPeer> bootstrapNodes = new ArrayList<>();
private final List<DiscoveryPeer> bootstrapNodes = new ArrayList<>();
private PeerTable peerTable;
private Subscribers<PeerBondedObserver> peerBondedObservers = Subscribers.create();

@ -123,7 +123,7 @@ public class DefaultP2PNetwork implements P2PNetwork {
private final PeerPermissions peerPermissions;
private final MaintainedPeers maintainedPeers;
private Optional<UpnpNatManager> natManager;
private final Optional<UpnpNatManager> natManager;
private Optional<String> natExternalAddress;
private OptionalLong peerBondedObserverId = OptionalLong.empty();

@ -27,7 +27,7 @@ import io.vertx.core.impl.ConcurrentHashSet;
import org.apache.tuweni.bytes.Bytes;
public class PeerPermissionsBlacklist extends PeerPermissions {
private static int DEFAULT_INITIAL_CAPACITY = 20;
private static final int DEFAULT_INITIAL_CAPACITY = 20;
private final Set<Bytes> blacklist;

@ -1242,7 +1242,7 @@ public class PeerDiscoveryControllerTest {
private PeerTable peerTable;
private OutboundMessageHandler outboundMessageHandler = OutboundMessageHandler.NOOP;
private static final PeerDiscoveryTestHelper helper = new PeerDiscoveryTestHelper();
private Subscribers<PeerBondedObserver> peerBondedObservers = Subscribers.create();
private final Subscribers<PeerBondedObserver> peerBondedObservers = Subscribers.create();
private PeerPermissions peerPermissions = PeerPermissions.noop();
public static ControllerBuilder create() {

@ -26,7 +26,7 @@ import org.junit.Test;
public class MaintainedPeersTest {
private MaintainedPeers maintainedPeers = new MaintainedPeers();
private final MaintainedPeers maintainedPeers = new MaintainedPeers();
@Test
public void add_newPeer() {

@ -161,7 +161,7 @@ public class AbstractPeerConnectionTest {
}
private static class TestPeerConnection extends AbstractPeerConnection {
private List<SentMessage> sentMessages = new ArrayList<>();
private final List<SentMessage> sentMessages = new ArrayList<>();
private int closedCount = 0;
TestPeerConnection(

@ -26,12 +26,13 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicInteger;
public class MockConnectionInitializer implements ConnectionInitializer {
private static AtomicInteger NEXT_PORT = new AtomicInteger(0);
private static final AtomicInteger NEXT_PORT = new AtomicInteger(0);
private final PeerConnectionEventDispatcher eventDispatcher;
private final Subscribers<ConnectCallback> connectCallbacks = Subscribers.create();
private boolean autocompleteConnections = true;
private Map<Peer, CompletableFuture<PeerConnection>> incompleteConnections = new HashMap<>();
private final Map<Peer, CompletableFuture<PeerConnection>> incompleteConnections =
new HashMap<>();
public MockConnectionInitializer(final PeerConnectionEventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;

@ -17,8 +17,8 @@ package org.hyperledger.besu.ethereum.permissioning;
import java.util.Optional;
public class PermissioningConfiguration {
private Optional<LocalPermissioningConfiguration> localConfig;
private Optional<SmartContractPermissioningConfiguration> smartContractConfig;
private final Optional<LocalPermissioningConfiguration> localConfig;
private final Optional<SmartContractPermissioningConfiguration> smartContractConfig;
public PermissioningConfiguration(
final Optional<LocalPermissioningConfiguration> localConfig,

@ -34,13 +34,13 @@ import org.apache.tuweni.toml.TomlParseResult;
public class WhitelistPersistor {
private File configurationFile;
private final File configurationFile;
public enum WHITELIST_TYPE {
ACCOUNTS("accounts-whitelist"),
NODES("nodes-whitelist");
private String tomlKey;
private final String tomlKey;
WHITELIST_TYPE(final String tomlKey) {
this.tomlKey = tomlKey;

@ -59,7 +59,7 @@ public class SyncStatusNodePermissioningProviderTest {
"enode://6f8a80d14311c39f35f516fa664deaaaa13e85b2f7493f37f6144d86991ec012937307647bd3b9a82abe2974e1407241d54947bbb39763a4cac9f77166ad92a0@192.168.0.3:5678");
@Mock private Synchronizer synchronizer;
private Collection<EnodeURL> bootnodes = new ArrayList<>();
private final Collection<EnodeURL> bootnodes = new ArrayList<>();
private SyncStatusNodePermissioningProvider provider;
private InSyncListener inSyncListener;

@ -24,7 +24,7 @@ public class RunnableCounter implements Counter {
private final Counter backedCounter;
private final Runnable task;
private final int step;
private AtomicLong stepCounter;
private final AtomicLong stepCounter;
public RunnableCounter(final Counter backedCounter, final Runnable task, final int step) {
this.backedCounter = backedCounter;

@ -49,7 +49,7 @@ public class RocksDBKeyValueStorageFactory implements KeyValueStorageFactory {
private static final String NAME = "rocksdb";
private final RocksDBMetricsFactory rocksDBMetricsFactory;
private int defaultVersion;
private final int defaultVersion;
private Integer databaseVersion;
private Boolean isSegmentIsolationSupported;
private SegmentedKeyValueStorage<?> segmentedStorage;

@ -34,7 +34,7 @@ public class DatabaseMetadata {
private static final Logger LOG = LogManager.getLogger();
private static final String METADATA_FILENAME = "DATABASE_METADATA.json";
private static ObjectMapper MAPPER = new ObjectMapper();
private static final ObjectMapper MAPPER = new ObjectMapper();
private final int version;
private Optional<Integer> privacyVersion;

@ -43,7 +43,7 @@ import org.apache.logging.log4j.Logger;
* @param <T> the type of subscribers
*/
public class Subscribers<T> {
private static Subscribers<?> NONE = new EmptySubscribers<>();
private static final Subscribers<?> NONE = new EmptySubscribers<>();
private static final Logger LOG = LogManager.getLogger();
private final AtomicLong subscriberId = new AtomicLong();

@ -21,7 +21,7 @@ import java.util.Objects;
public class Fraction {
private float value;
private final float value;
private Fraction(final float value) {
this.value = value;

@ -21,7 +21,7 @@ import java.util.Objects;
public class Percentage {
private int value;
private final int value;
private Percentage(final int value) {
this.value = value;

@ -21,7 +21,7 @@ import java.util.Objects;
public class PositiveNumber {
private int value;
private final int value;
private PositiveNumber(final int value) {
this.value = value;

Loading…
Cancel
Save