Fix code quality issues

Per Codacy report at
https://app.codacy.com/gh/bisq-network/bisq/pullRequest?prid=4835063
This commit is contained in:
Chris Beams 2020-01-17 12:40:33 +01:00
parent 65175a7f4f
commit 7595387c8e
No known key found for this signature in database
GPG key ID: 3D214F8F5BC5ED73

View file

@ -35,6 +35,7 @@ import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static java.lang.String.format;
@ -65,7 +66,6 @@ import io.grpc.StatusRuntimeException;
*/ */
@Slf4j @Slf4j
public class BisqGrpcClient { public class BisqGrpcClient {
private static BisqGrpcClient instance;
private final ManagedChannel channel; private final ManagedChannel channel;
private final GetVersionGrpc.GetVersionBlockingStub getVersionStub; private final GetVersionGrpc.GetVersionBlockingStub getVersionStub;
@ -76,10 +76,9 @@ public class BisqGrpcClient {
private final GetPaymentAccountsGrpc.GetPaymentAccountsBlockingStub getPaymentAccountsStub; private final GetPaymentAccountsGrpc.GetPaymentAccountsBlockingStub getPaymentAccountsStub;
private final PlaceOfferGrpc.PlaceOfferBlockingStub placeOfferBlockingStub; private final PlaceOfferGrpc.PlaceOfferBlockingStub placeOfferBlockingStub;
private final CorePersistenceProtoResolver corePersistenceProtoResolver; private final CorePersistenceProtoResolver corePersistenceProtoResolver;
private final CoreNetworkProtoResolver coreNetworkProtoResolver;
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
instance = new BisqGrpcClient("localhost", 8888); new BisqGrpcClient("localhost", 8888);
} }
private BisqGrpcClient(String host, int port) { private BisqGrpcClient(String host, int port) {
@ -176,6 +175,8 @@ public class BisqGrpcClient {
stopServer(); stopServer();
result = "Server stopped"; result = "Server stopped";
break; break;
default:
result = format("Unknown command '%s'", command);
} }
// First response is rather slow (300 ms) but following responses are fast (3-5 ms). // First response is rather slow (300 ms) but following responses are fast (3-5 ms).
@ -199,7 +200,7 @@ public class BisqGrpcClient {
placeOfferBlockingStub = PlaceOfferGrpc.newBlockingStub(channel); placeOfferBlockingStub = PlaceOfferGrpc.newBlockingStub(channel);
stopServerStub = StopServerGrpc.newBlockingStub(channel); stopServerStub = StopServerGrpc.newBlockingStub(channel);
coreNetworkProtoResolver = new CoreNetworkProtoResolver(Clock.systemDefaultZone()); CoreNetworkProtoResolver coreNetworkProtoResolver = new CoreNetworkProtoResolver(Clock.systemDefaultZone());
//TODO //TODO
corePersistenceProtoResolver = new CorePersistenceProtoResolver(null, coreNetworkProtoResolver, null, null); corePersistenceProtoResolver = new CorePersistenceProtoResolver(null, coreNetworkProtoResolver, null, null);
} }