From 7595387c8e59a59e34fcf2818cfd220e083a4b75 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Fri, 17 Jan 2020 12:40:33 +0100 Subject: [PATCH] Fix code quality issues Per Codacy report at https://app.codacy.com/gh/bisq-network/bisq/pullRequest?prid=4835063 --- grpc/src/main/java/bisq/grpc/BisqGrpcClient.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/grpc/src/main/java/bisq/grpc/BisqGrpcClient.java b/grpc/src/main/java/bisq/grpc/BisqGrpcClient.java index d3d698cf791..489946b2f7d 100644 --- a/grpc/src/main/java/bisq/grpc/BisqGrpcClient.java +++ b/grpc/src/main/java/bisq/grpc/BisqGrpcClient.java @@ -35,6 +35,7 @@ import lombok.extern.slf4j.Slf4j; import static com.google.common.base.Preconditions.checkArgument; +import static java.lang.String.format; @@ -65,7 +66,6 @@ */ @Slf4j public class BisqGrpcClient { - private static BisqGrpcClient instance; private final ManagedChannel channel; private final GetVersionGrpc.GetVersionBlockingStub getVersionStub; @@ -76,10 +76,9 @@ public class BisqGrpcClient { private final GetPaymentAccountsGrpc.GetPaymentAccountsBlockingStub getPaymentAccountsStub; private final PlaceOfferGrpc.PlaceOfferBlockingStub placeOfferBlockingStub; private final CorePersistenceProtoResolver corePersistenceProtoResolver; - private final CoreNetworkProtoResolver coreNetworkProtoResolver; public static void main(String[] args) throws Exception { - instance = new BisqGrpcClient("localhost", 8888); + new BisqGrpcClient("localhost", 8888); } private BisqGrpcClient(String host, int port) { @@ -176,6 +175,8 @@ private BisqGrpcClient(String host, int port) { stopServer(); result = "Server stopped"; break; + default: + result = format("Unknown command '%s'", command); } // First response is rather slow (300 ms) but following responses are fast (3-5 ms). @@ -199,7 +200,7 @@ private BisqGrpcClient(ManagedChannel channel) { placeOfferBlockingStub = PlaceOfferGrpc.newBlockingStub(channel); stopServerStub = StopServerGrpc.newBlockingStub(channel); - coreNetworkProtoResolver = new CoreNetworkProtoResolver(Clock.systemDefaultZone()); + CoreNetworkProtoResolver coreNetworkProtoResolver = new CoreNetworkProtoResolver(Clock.systemDefaultZone()); //TODO corePersistenceProtoResolver = new CorePersistenceProtoResolver(null, coreNetworkProtoResolver, null, null); }