Skip to content

Commit a8f696f

Browse files
committed
fix style
1 parent fb0e733 commit a8f696f

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import io.grpc.internal.ClientStream;
5050
import io.grpc.internal.ClientStreamListener.RpcProgress;
5151
import io.grpc.internal.ConnectionClientTransport;
52-
import io.grpc.internal.FailingClientStream;
5352
import io.grpc.internal.GrpcAttributes;
5453
import io.grpc.internal.GrpcUtil;
5554
import io.grpc.internal.Http2Ping;
@@ -247,12 +246,12 @@ private static Map<ErrorCode, Status> buildErrorCodeToStatusMap() {
247246
@GuardedBy("lock")
248247
private final TransportTracer transportTracer;
249248
private final Map<String, Status> peerVerificationResults = Collections.synchronizedMap(
250-
new LinkedHashMap<String, Status>() {
251-
@Override
252-
protected boolean removeEldestEntry(Map.Entry<String, Status> eldest) {
253-
return size() > 100;
254-
}
255-
});
249+
new LinkedHashMap<String, Status>() {
250+
@Override
251+
protected boolean removeEldestEntry(Map.Entry<String, Status> eldest) {
252+
return size() > 100;
253+
}
254+
});
256255

257256
@GuardedBy("lock")
258257
private final InUseStateAggregator<OkHttpClientStream> inUseState =
@@ -520,23 +519,26 @@ void streamReadyToStart(OkHttpClientStream clientStream, String authority) {
520519
}
521520
}
522521
if (socket instanceof SSLSocket && authority != null
523-
&& channelCredentials != null && channelCredentials instanceof TlsChannelCredentials) {
522+
&& channelCredentials != null
523+
&& channelCredentials instanceof TlsChannelCredentials) {
524524
Status peerVerificationStatus = null;
525525
if (peerVerificationResults.containsKey(authority)) {
526526
peerVerificationStatus = peerVerificationResults.get(authority);
527527
} else {
528528
TrustManager x509ExtendedTrustManager = null;
529529
try {
530530
x509ExtendedTrustManager = x509ExtendedTrustManagerClass != null
531-
? getX509ExtendedTrustManager((TlsChannelCredentials) channelCredentials) : null;
531+
? getX509ExtendedTrustManager((TlsChannelCredentials) channelCredentials)
532+
: null;
532533
} catch (GeneralSecurityException e) {
533534
peerVerificationStatus = Status.UNAVAILABLE.withCause(e)
534535
.withDescription("Could not verify authority due to failure getting "
535536
+ "X509ExtendedTrustManager from TlsCredentials");
536537
}
537538
if (x509ExtendedTrustManager == null) {
538-
peerVerificationStatus = Status.UNAVAILABLE.withDescription(String.format("Could not verify authority '%s' for "
539-
+ "the rpc with no X509ExtendedTrustManager available",
539+
peerVerificationStatus = Status.UNAVAILABLE.withDescription(
540+
String.format("Could not verify authority '%s' for the rpc with no "
541+
+ "X509ExtendedTrustManager available",
540542
authority));
541543
}
542544
if (x509ExtendedTrustManager != null) {
@@ -567,7 +569,8 @@ void streamReadyToStart(OkHttpClientStream clientStream, String authority) {
567569
} else {
568570
if (peerVerificationStatus.getCause() != null) {
569571
log.log(Level.WARNING, peerVerificationStatus.getDescription()
570-
+ ". This will be an error in the future.", peerVerificationStatus.getCause());
572+
+ ". This will be an error in the future.",
573+
peerVerificationStatus.getCause());
571574
} else {
572575
log.log(Level.WARNING, peerVerificationStatus.getDescription()
573576
+ ". This will be an error in the future.");

okhttp/src/test/java/io/grpc/okhttp/TlsTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import javax.net.ssl.X509ExtendedTrustManager;
6363
import javax.net.ssl.X509TrustManager;
6464
import javax.security.auth.x500.X500Principal;
65-
6665
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
6766
import org.junit.Assume;
6867
import org.junit.Before;
@@ -184,7 +183,7 @@ public boolean verify(String hostname, SSLSession session) {
184183
.build()));
185184

186185
try {
187-
ClientCalls.blockingUnaryCall(channel, SimpleServiceGrpc.getUnaryRpcMethod(),
186+
ClientCalls.blockingUnaryCall(channel, SimpleServiceGrpc.getUnaryRpcMethod(),
188187
CallOptions.DEFAULT.withAuthority("foo.test.google.in"),
189188
SimpleRequest.getDefaultInstance());
190189
fail("Expected exception for hostname verifier failure.");

0 commit comments

Comments
 (0)