diff --git a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java index 6346773d5d2c..d32b6d385e90 100644 --- a/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java +++ b/google-cloud-logging/src/main/java/com/google/cloud/logging/spi/v2/GrpcLoggingRpc.java @@ -82,12 +82,11 @@ public GrpcLoggingRpc(LoggingOptions options) throws IOException { ChannelProvider channelProvider; // todo(mziccard): ChannelProvider should support null/absent credentials for testing if (options.getHost().contains("localhost") - || NoCredentials.getInstance().equals(options.getCredentials())) { - ManagedChannel managedChannel = - ManagedChannelBuilder.forTarget(options.getHost()) - .usePlaintext(true) - .executor(executor) - .build(); + || options.getCredentials().equals(NoCredentials.getInstance())) { + ManagedChannel managedChannel = ManagedChannelBuilder.forTarget(options.getHost()) + .usePlaintext(true) + .executor(executor) + .build(); channelProvider = FixedChannelProvider.create(managedChannel); } else { channelProvider = GrpcTransportOptions.setUpChannelProvider(