From fd59570e2cb30425bcae5f231e4d22e9ef037410 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Wed, 28 Jul 2021 22:44:27 -0600 Subject: [PATCH] Update spotless and google-java-format (#2593) Update spotless to 5.14.2 and java-google-format to 1.10.0. Both of these are needed to support Java 16 and Gradle 7.x. Signed-off-by: Danno Ferrin --- .../tests/acceptance/dsl/node/cluster/Cluster.java | 3 +-- .../tests/web3j/generated/CrossContractReader.java | 2 +- .../besu/tests/web3j/generated/EventEmitter.java | 2 +- .../besu/cli/custom/RpcAuthFileValidator.java | 8 ++------ build.gradle | 4 ++-- .../besu/tests/container/ContainerTestBase.java | 2 +- .../besu/ethereum/api/ApiConfiguration.java | 2 +- .../api/jsonrpc/internal/methods/DebugAccountAt.java | 7 +++++-- .../jsonrpc/internal/methods/DebugGetBadBlocks.java | 7 +++++-- .../api/jsonrpc/internal/methods/JsonRpcMethod.java | 2 +- .../jsonrpc/internal/methods/TraceTransaction.java | 7 +++++-- .../methods/PrivacyApiGroupJsonRpcMethods.java | 3 ++- .../subscription/logs/LogsSubscriptionService.java | 3 ++- .../api/query/TransactionReceiptWithMetadata.java | 2 +- .../besu/ethereum/mainnet/LondonGasCalculator.java | 2 +- .../hyperledger/besu/ethereum/vm/GasCalculator.java | 2 +- .../hyperledger/besu/ethereum/vm/MessageFrame.java | 7 ++----- .../privacy/ChainHeadPrivateNonceProviderTest.java | 2 +- .../besu/ethereum/eth/LegacyForkIdManager.java | 2 +- .../eth/manager/task/WaitForPeerTaskTest.java | 2 +- .../eth/manager/task/WaitForPeersTaskTest.java | 2 +- .../besu/ethereum/p2p/network/NetworkRunner.java | 2 +- .../ethereum/permissioning/AllowlistPersistor.java | 11 +++-------- .../PermissioningConfigurationBuilder.java | 8 ++------ .../besu/nat/kubernetes/KubernetesNatManager.java | 6 ++++-- .../java/org/hyperledger/besu/pki/crl/CRLUtil.java | 3 ++- plugin-api/build.gradle | 2 +- .../org/hyperledger/besu/plugin/data/SyncStatus.java | 4 ++-- .../DefaultOnChainPrivacyGroupManagementContract.java | 2 +- .../generated/OnChainPrivacyGroupManagementProxy.java | 2 +- 30 files changed, 55 insertions(+), 58 deletions(-) diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/cluster/Cluster.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/cluster/Cluster.java index 794d25b6ba..8a118a635e 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/cluster/Cluster.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/node/cluster/Cluster.java @@ -85,8 +85,7 @@ public class Cluster implements AutoCloseable { final Optional bootnode = selectAndStartBootnode(nodes); - nodes - .parallelStream() + nodes.parallelStream() .filter( node -> { LOG.info("starting non-bootnode {}", node.getName()); diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/CrossContractReader.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/CrossContractReader.java index ef87c493c5..eb20299c20 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/CrossContractReader.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/CrossContractReader.java @@ -71,7 +71,7 @@ public class CrossContractReader extends Contract { public static final Event NEWEVENTEMITTER_EVENT = new Event( - "NewEventEmitter", Arrays.>asList(new TypeReference
() {}));; + "NewEventEmitter", Arrays.>asList(new TypeReference
() {})); @Deprecated protected CrossContractReader( diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/EventEmitter.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/EventEmitter.java index 6153433b0b..37b888f0b3 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/EventEmitter.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/generated/EventEmitter.java @@ -67,7 +67,7 @@ public class EventEmitter extends Contract { new Event( "stored", Arrays.>asList( - new TypeReference
() {}, new TypeReference() {}));; + new TypeReference
() {}, new TypeReference() {})); @Deprecated protected EventEmitter( diff --git a/besu/src/main/java/org/hyperledger/besu/cli/custom/RpcAuthFileValidator.java b/besu/src/main/java/org/hyperledger/besu/cli/custom/RpcAuthFileValidator.java index 40a9155799..d212272593 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/custom/RpcAuthFileValidator.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/custom/RpcAuthFileValidator.java @@ -80,9 +80,7 @@ public class RpcAuthFileValidator { int configuredUsers = tomlParseResult.getTable("Users").keySet().size(); int usersWithPasswords = - tomlParseResult - .keyPathSet() - .parallelStream() + tomlParseResult.keyPathSet().parallelStream() .filter( keySet -> keySet.contains("Users") @@ -95,9 +93,7 @@ public class RpcAuthFileValidator { } private static boolean verifyAllEntriesHaveValues(final TomlParseResult tomlParseResult) { - return tomlParseResult - .dottedKeySet() - .parallelStream() + return tomlParseResult.dottedKeySet().parallelStream() .filter(keySet -> !keySet.contains("password")) .allMatch(dottedKey -> verifyEntry(dottedKey, tomlParseResult)); } diff --git a/build.gradle b/build.gradle index e067ce69df..6ac8497eb9 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ import net.ltgt.gradle.errorprone.CheckSeverity import java.text.SimpleDateFormat plugins { - id 'com.diffplug.spotless' version '5.9.0' + id 'com.diffplug.spotless' version '5.14.2' id 'com.github.ben-manes.versions' version '0.36.0' id 'com.github.hierynomus.license' version '0.15.0' id 'com.jfrog.artifactory' version '4.20.0' @@ -128,7 +128,7 @@ allprojects { exclude '**/.gradle/**' } removeUnusedImports() - googleJavaFormat('1.7') + googleJavaFormat('1.10.0') importOrder 'org.hyperledger', 'java', '' trimTrailingWhitespace() endWithNewline() diff --git a/container-tests/tests/src/test/java/org/hyperledger/besu/tests/container/ContainerTestBase.java b/container-tests/tests/src/test/java/org/hyperledger/besu/tests/container/ContainerTestBase.java index a6aee7df89..6090743968 100644 --- a/container-tests/tests/src/test/java/org/hyperledger/besu/tests/container/ContainerTestBase.java +++ b/container-tests/tests/src/test/java/org/hyperledger/besu/tests/container/ContainerTestBase.java @@ -114,7 +114,7 @@ public class ContainerTestBase { @Rule public final GenericContainer goQuorumContainer = - buildGoQuorumContainer(ipcDirPath, ipcBindDir, containerIpcPath);; + buildGoQuorumContainer(ipcDirPath, ipcBindDir, containerIpcPath); @Before public void setUp() throws IOException, InterruptedException { diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/ApiConfiguration.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/ApiConfiguration.java index 8aabbe1bf8..f8b52054d5 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/ApiConfiguration.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/ApiConfiguration.java @@ -45,5 +45,5 @@ public abstract class ApiConfiguration { @Value.Derived public double getGasPriceFraction() { return getGasPricePercentile() / 100.0; - }; + } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugAccountAt.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugAccountAt.java index 4821fcde1d..d8aacceae9 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugAccountAt.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugAccountAt.java @@ -86,9 +86,12 @@ public class DebugAccountAt extends AbstractBlockParameterOrBlockHashMethod { } final Optional transactionTrace = - blockTracerSupplier.get() + blockTracerSupplier + .get() .trace(blockHash, new DebugOperationTracer(new TraceOptions(false, true, true))) - .map(BlockTrace::getTransactionTraces).orElse(Collections.emptyList()).stream() + .map(BlockTrace::getTransactionTraces) + .orElse(Collections.emptyList()) + .stream() .filter( trxTrace -> trxTrace diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetBadBlocks.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetBadBlocks.java index aac609bc6d..8c49f9a9b5 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetBadBlocks.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/DebugGetBadBlocks.java @@ -49,8 +49,11 @@ public class DebugGetBadBlocks implements JsonRpcMethod { @Override public JsonRpcResponse response(final JsonRpcRequestContext requestContext) { final List response = - protocolSchedule.getByBlockNumber(blockchain.headBlockNumber()).getBadBlocksManager() - .getBadBlocks().stream() + protocolSchedule + .getByBlockNumber(blockchain.headBlockNumber()) + .getBadBlocksManager() + .getBadBlocks() + .stream() .map(block -> BadBlockResult.from(blockResultFactory.transactionComplete(block), block)) .collect(Collectors.toList()); return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), response); diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonRpcMethod.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonRpcMethod.java index 20e3a521d1..c0b1783ce7 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonRpcMethod.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/JsonRpcMethod.java @@ -50,5 +50,5 @@ public interface JsonRpcMethod { permissions.add(this.getName().substring(0, this.getName().indexOf('_')) + ":*"); permissions.add(this.getName().replace('_', ':')); return permissions; - }; + } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceTransaction.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceTransaction.java index 35dde21f64..24e62531ff 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceTransaction.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/methods/TraceTransaction.java @@ -78,9 +78,12 @@ public class TraceTransaction implements JsonRpcMethod { return emptyResult(); } final TransactionTrace transactionTrace = - blockTracerSupplier.get() + blockTracerSupplier + .get() .trace(block, new DebugOperationTracer(new TraceOptions(false, false, true))) - .map(BlockTrace::getTransactionTraces).orElse(Collections.emptyList()).stream() + .map(BlockTrace::getTransactionTraces) + .orElse(Collections.emptyList()) + .stream() .filter(trxTrace -> trxTrace.getTransaction().getHash().equals(transactionHash)) .findFirst() .orElseThrow(); diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/PrivacyApiGroupJsonRpcMethods.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/PrivacyApiGroupJsonRpcMethods.java index 4cb7ed07b1..5954752840 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/PrivacyApiGroupJsonRpcMethods.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/methods/PrivacyApiGroupJsonRpcMethods.java @@ -98,7 +98,8 @@ public abstract class PrivacyApiGroupJsonRpcMethods extends ApiGroupJsonRpcMetho createPrivateMarkerTransactionFactory(); final PrivacyIdProvider enclavePublicProvider = PrivacyIdProvider.build(privacyParameters); final PrivacyController privacyController = createPrivacyController(); - return create(privacyController, enclavePublicProvider, markerTransactionFactory).entrySet() + return create(privacyController, enclavePublicProvider, markerTransactionFactory) + .entrySet() .stream() .collect( Collectors.toMap( diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/subscription/logs/LogsSubscriptionService.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/subscription/logs/LogsSubscriptionService.java index 36b3cd8c72..960c76f24c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/subscription/logs/LogsSubscriptionService.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/websocket/subscription/logs/LogsSubscriptionService.java @@ -60,7 +60,8 @@ public class LogsSubscriptionService implements Consumer { public void checkPrivateLogs(final BlockAddedEvent event) { privacyQueries.ifPresent( pq -> - subscriptionManager.subscriptionsOfType(SubscriptionType.LOGS, LogsSubscription.class) + subscriptionManager + .subscriptionsOfType(SubscriptionType.LOGS, LogsSubscription.class) .stream() .filter(PrivateLogsSubscription.class::isInstance) .map(PrivateLogsSubscription.class::cast) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionReceiptWithMetadata.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionReceiptWithMetadata.java index 522a743c86..1bcdfd9ad1 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionReceiptWithMetadata.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/query/TransactionReceiptWithMetadata.java @@ -101,5 +101,5 @@ public class TransactionReceiptWithMetadata { public Optional getBaseFee() { return baseFee; - }; + } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/LondonGasCalculator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/LondonGasCalculator.java index 2baaf5c4b0..77b6896005 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/LondonGasCalculator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/mainnet/LondonGasCalculator.java @@ -80,5 +80,5 @@ public class LondonGasCalculator extends BerlinGasCalculator { @Override public long getMaxRefundQuotient() { return NEW_MAX_REFUND_QUOTIENT; - }; + } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/GasCalculator.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/GasCalculator.java index 890a2aa1fe..71f34916b4 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/GasCalculator.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/GasCalculator.java @@ -437,7 +437,7 @@ public interface GasCalculator { default long getMaxRefundQuotient() { return 2; - }; + } // what would be the gas for a PMT with hash of all non-zeros Gas getMaximumPmtCost(); diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/MessageFrame.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/MessageFrame.java index e5d5f071e1..d60b7912c2 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/MessageFrame.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/vm/MessageFrame.java @@ -328,16 +328,13 @@ public class MessageFrame { // the warmed up addresses will always be a superset of the address keys in the warmed up // storage so we can do both warm ups in one pass - accessListWarmAddresses - .parallelStream() + accessListWarmAddresses.parallelStream() .forEach( address -> Optional.ofNullable(worldState.get(address)) .ifPresent( account -> - warmedUpStorage - .get(address) - .parallelStream() + warmedUpStorage.get(address).parallelStream() .forEach( storageKeyBytes -> account.getStorageValue( diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/ChainHeadPrivateNonceProviderTest.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/ChainHeadPrivateNonceProviderTest.java index f4f1974fbb..52c80da0a9 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/ChainHeadPrivateNonceProviderTest.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/privacy/ChainHeadPrivateNonceProviderTest.java @@ -38,7 +38,7 @@ import org.junit.Test; public class ChainHeadPrivateNonceProviderTest { private static final Bytes32 PRIVACY_GROUP_ID = Bytes32.wrap(Bytes.fromBase64String("DyAOiF/ynpc+JXa2YAGB0bCitSlOMNm+ShmB/7M6C4w=")); - private static final Address ADDRESS = Address.fromHexString("55");; + private static final Address ADDRESS = Address.fromHexString("55"); private Account account; private WorldState worldState; diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/LegacyForkIdManager.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/LegacyForkIdManager.java index e3404196ce..48eb4f7a51 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/LegacyForkIdManager.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/LegacyForkIdManager.java @@ -38,7 +38,7 @@ public class LegacyForkIdManager { this.forks = forks.stream().filter(fork -> fork > 0).distinct().collect(Collectors.toUnmodifiableList()); createForkIds(); - }; + } public List getForkAndHashList() { return this.forkAndHashList; diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/WaitForPeerTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/WaitForPeerTaskTest.java index c00f9efdd6..3690723f24 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/WaitForPeerTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/WaitForPeerTaskTest.java @@ -32,7 +32,7 @@ import org.junit.Test; public class WaitForPeerTaskTest { private EthProtocolManager ethProtocolManager; private EthContext ethContext; - private final MetricsSystem metricsSystem = new NoOpMetricsSystem();; + private final MetricsSystem metricsSystem = new NoOpMetricsSystem(); @Before public void setupTest() { diff --git a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/WaitForPeersTaskTest.java b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/WaitForPeersTaskTest.java index 16283f7746..275026473a 100644 --- a/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/WaitForPeersTaskTest.java +++ b/ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/manager/task/WaitForPeersTaskTest.java @@ -32,7 +32,7 @@ import org.junit.Test; public class WaitForPeersTaskTest { private EthProtocolManager ethProtocolManager; private EthContext ethContext; - private final MetricsSystem metricsSystem = new NoOpMetricsSystem();; + private final MetricsSystem metricsSystem = new NoOpMetricsSystem(); @Before public void setupTest() { diff --git a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/NetworkRunner.java b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/NetworkRunner.java index 294d1f5c63..8049ca3962 100644 --- a/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/NetworkRunner.java +++ b/ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/network/NetworkRunner.java @@ -38,7 +38,7 @@ import org.apache.logging.log4j.Logger; public class NetworkRunner implements AutoCloseable { private static final Logger LOG = LogManager.getLogger(); - private final CountDownLatch shutdown = new CountDownLatch(1);; + private final CountDownLatch shutdown = new CountDownLatch(1); private final AtomicBoolean started = new AtomicBoolean(false); private final AtomicBoolean stopped = new AtomicBoolean(false); diff --git a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/AllowlistPersistor.java b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/AllowlistPersistor.java index 1f4e583e6c..5c98a3ca98 100644 --- a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/AllowlistPersistor.java +++ b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/AllowlistPersistor.java @@ -102,9 +102,7 @@ public class AllowlistPersistor { Collectors.toMap( o -> o.getKey(), o -> - o.getValue() - .toList() - .parallelStream() + o.getValue().toList().parallelStream() .map(Object::toString) .collect(Collectors.toList()))); } @@ -112,9 +110,7 @@ public class AllowlistPersistor { @VisibleForTesting void removeExistingConfigItem(final ALLOWLIST_TYPE allowlistType) throws IOException { List otherConfigItems = - existingConfigItems(configurationFile.toPath()) - .entrySet() - .parallelStream() + existingConfigItems(configurationFile.toPath()).entrySet().parallelStream() .filter(listType -> !listType.getKey().equals(allowlistType)) .map(keyVal -> valueListToTomlArray(keyVal.getKey(), keyVal.getValue())) .collect(Collectors.toList()); @@ -153,8 +149,7 @@ public class AllowlistPersistor { return String.format( "%s=[%s]", allowlistType.getTomlKey(), - allowlistValues - .parallelStream() + allowlistValues.parallelStream() .map(uri -> String.format("\"%s\"", uri)) .collect(Collectors.joining(","))); } diff --git a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfigurationBuilder.java b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfigurationBuilder.java index cc0ead1acf..8ff6fbf863 100644 --- a/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfigurationBuilder.java +++ b/ethereum/permissioning/src/main/java/org/hyperledger/besu/ethereum/permissioning/PermissioningConfigurationBuilder.java @@ -77,9 +77,7 @@ public class PermissioningConfigurationBuilder { if (nodeAllowlistTomlArray != null) { List nodesAllowlistToml = - nodeAllowlistTomlArray - .toList() - .parallelStream() + nodeAllowlistTomlArray.toList().parallelStream() .map(Object::toString) .map( url -> @@ -114,9 +112,7 @@ public class PermissioningConfigurationBuilder { if (accountAllowlistTomlArray != null) { List accountsAllowlistToml = - accountAllowlistTomlArray - .toList() - .parallelStream() + accountAllowlistTomlArray.toList().parallelStream() .map(Object::toString) .collect(Collectors.toList()); diff --git a/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java b/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java index 260b90a857..7d203da938 100644 --- a/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java +++ b/nat/src/main/java/org/hyperledger/besu/nat/kubernetes/KubernetesNatManager.java @@ -77,8 +77,10 @@ public class KubernetesNatManager extends AbstractNatManager { final CoreV1Api api = new CoreV1Api(); // invokes the CoreV1Api client final V1Service service = - api.listServiceForAllNamespaces(null, null, null, null, null, null, null, null, null) - .getItems().stream() + api + .listServiceForAllNamespaces(null, null, null, null, null, null, null, null, null) + .getItems() + .stream() .filter( v1Service -> v1Service.getMetadata().getName().contains(besuServiceNameFilter)) .findFirst() diff --git a/pki/src/main/java/org/hyperledger/besu/pki/crl/CRLUtil.java b/pki/src/main/java/org/hyperledger/besu/pki/crl/CRLUtil.java index 6188382dcd..f172f57ca2 100644 --- a/pki/src/main/java/org/hyperledger/besu/pki/crl/CRLUtil.java +++ b/pki/src/main/java/org/hyperledger/besu/pki/crl/CRLUtil.java @@ -31,7 +31,8 @@ public class CRLUtil { try { final List crls = CertificateFactory.getInstance("X509") - .generateCRLs(new FileInputStream(Paths.get(path).toFile())).stream() + .generateCRLs(new FileInputStream(Paths.get(path).toFile())) + .stream() .map(X509CRL.class::cast) .collect(Collectors.toList()); diff --git a/plugin-api/build.gradle b/plugin-api/build.gradle index bbd4c2af0c..6557231ee3 100644 --- a/plugin-api/build.gradle +++ b/plugin-api/build.gradle @@ -64,7 +64,7 @@ Calculated : ${currentHash} tasks.register('checkAPIChanges', FileStateChecker) { description = "Checks that the API for the Plugin-API project does not change without deliberate thought" files = sourceSets.main.allJava.files - knownHash = 'HVhl+xNOt6THTZvQNZ9NnOIQB6AkN+wq+1stbnqe6ig=' + knownHash = 'jzeZ7YS9/4K+Q4TZMbrUlkDnDce6mCRisy1CoCTxoa8=' } check.dependsOn('checkAPIChanges') diff --git a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/SyncStatus.java b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/SyncStatus.java index 2e9cb47c76..c073e289ed 100644 --- a/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/SyncStatus.java +++ b/plugin-api/src/main/java/org/hyperledger/besu/plugin/data/SyncStatus.java @@ -50,7 +50,7 @@ public interface SyncStatus { @Unstable default Optional getPulledStates() { return Optional.empty(); - }; + } /** * KnownStates is the number of states the node knows of so far, or empty if this is not known or @@ -61,5 +61,5 @@ public interface SyncStatus { @Unstable default Optional getKnownStates() { return Optional.empty(); - }; + } } diff --git a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultOnChainPrivacyGroupManagementContract.java b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultOnChainPrivacyGroupManagementContract.java index d65d98f2e1..ea038adeea 100644 --- a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultOnChainPrivacyGroupManagementContract.java +++ b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/DefaultOnChainPrivacyGroupManagementContract.java @@ -82,7 +82,7 @@ public class DefaultOnChainPrivacyGroupManagementContract extends Contract { Arrays.>asList( new TypeReference() {}, new TypeReference() {}, - new TypeReference() {}));; + new TypeReference() {})); @Deprecated protected DefaultOnChainPrivacyGroupManagementContract( diff --git a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/OnChainPrivacyGroupManagementProxy.java b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/OnChainPrivacyGroupManagementProxy.java index 711c217061..a439ae5531 100644 --- a/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/OnChainPrivacyGroupManagementProxy.java +++ b/privacy-contracts/src/main/java/org/hyperledger/besu/privacy/contracts/generated/OnChainPrivacyGroupManagementProxy.java @@ -83,7 +83,7 @@ public class OnChainPrivacyGroupManagementProxy extends Contract { public static final Event PARTICIPANTREMOVED_EVENT = new Event( - "ParticipantRemoved", Arrays.>asList(new TypeReference() {}));; + "ParticipantRemoved", Arrays.>asList(new TypeReference() {})); @Deprecated protected OnChainPrivacyGroupManagementProxy(