Skip to content

Commit 5ba5431

Browse files
committed
nit changes and drop unintended changes.
1 parent b0f86cf commit 5ba5431

File tree

4 files changed

+21
-53
lines changed

4 files changed

+21
-53
lines changed

examples/example-tls/src/main/java/io/grpc/examples/helloworldtls/HelloWorldClientTls.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package io.grpc.examples.helloworldtls;
1818

19-
import io.grpc.CallOptions;
2019
import io.grpc.Channel;
2120
import io.grpc.Grpc;
2221
import io.grpc.ManagedChannel;
@@ -53,9 +52,7 @@ public void greet(String name) {
5352
HelloRequest request = HelloRequest.newBuilder().setName(name).build();
5453
HelloReply response;
5554
try {
56-
// response = blockingStub.sayHello(request);
57-
response = io.grpc.stub.ClientCalls.blockingUnaryCall(
58-
blockingStub.getChannel(), GreeterGrpc.getSayHelloMethod(), CallOptions.DEFAULT.withAuthority("localhost"), request);
55+
response = blockingStub.sayHello(request);
5956
} catch (StatusRuntimeException e) {
6057
logger.log(Level.WARNING, "RPC failed: {0}", e.getStatus());
6158
return;
@@ -71,8 +68,8 @@ public static void main(String[] args) throws Exception {
7168

7269
if (args.length < 2 || args.length == 4 || args.length > 5) {
7370
System.out.println("USAGE: HelloWorldClientTls host port [trustCertCollectionFilePath " +
74-
"[clientCertChainFilePath clientPrivateKeyFilePath]]\n Note: clientCertChainFilePath and " +
75-
"clientPrivateKeyFilePath are only needed if mutual auth is desired.");
71+
"[clientCertChainFilePath clientPrivateKeyFilePath]]\n Note: clientCertChainFilePath and " +
72+
"clientPrivateKeyFilePath are only needed if mutual auth is desired.");
7673
System.exit(0);
7774
}
7875

@@ -91,9 +88,9 @@ public static void main(String[] args) throws Exception {
9188
String host = args[0];
9289
int port = Integer.parseInt(args[1]);
9390
ManagedChannel channel = Grpc.newChannelBuilderForAddress(host, port, tlsBuilder.build())
94-
/* Only for using provided test certs. */
95-
.overrideAuthority("foo.test.google.fr")
96-
.build();
91+
/* Only for using provided test certs. */
92+
.overrideAuthority("foo.test.google.fr")
93+
.build();
9794
try {
9895
HelloWorldClientTls client = new HelloWorldClientTls(channel);
9996
client.greet(host);

netty/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ tasks.named("jar").configure {
1717

1818
dependencies {
1919
api project(':grpc-api'),
20-
libraries.netty.codec.http2
21-
implementation project(':grpc-util'),
20+
libraries.netty.codec.http2,
2221
project(':grpc-core'),
2322
libs.netty.handler.proxy,
2423
libraries.guava,

netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,9 +1258,7 @@ public boolean isInboundDone() {
12581258
}
12591259

12601260
@Override
1261-
public void closeOutbound() {
1262-
1263-
}
1261+
public void closeOutbound() {}
12641262

12651263
@Override
12661264
public boolean isOutboundDone() {
@@ -1278,9 +1276,7 @@ public String[] getEnabledCipherSuites() {
12781276
}
12791277

12801278
@Override
1281-
public void setEnabledCipherSuites(String[] strings) {
1282-
1283-
}
1279+
public void setEnabledCipherSuites(String[] strings) {}
12841280

12851281
@Override
12861282
public String[] getSupportedProtocols() {
@@ -1293,59 +1289,47 @@ public String[] getEnabledProtocols() {
12931289
}
12941290

12951291
@Override
1296-
public void setEnabledProtocols(String[] strings) {
1297-
1298-
}
1292+
public void setEnabledProtocols(String[] strings) {}
12991293

13001294
@Override
13011295
public SSLSession getSession() {
13021296
return null;
13031297
}
13041298

13051299
@Override
1306-
public void beginHandshake() throws SSLException {
1307-
1308-
}
1300+
public void beginHandshake() throws SSLException {}
13091301

13101302
@Override
13111303
public HandshakeStatus getHandshakeStatus() {
13121304
return null;
13131305
}
13141306

13151307
@Override
1316-
public void setUseClientMode(boolean b) {
1317-
1318-
}
1308+
public void setUseClientMode(boolean b) {}
13191309

13201310
@Override
13211311
public boolean getUseClientMode() {
13221312
return false;
13231313
}
13241314

13251315
@Override
1326-
public void setNeedClientAuth(boolean b) {
1327-
1328-
}
1316+
public void setNeedClientAuth(boolean b) {}
13291317

13301318
@Override
13311319
public boolean getNeedClientAuth() {
13321320
return false;
13331321
}
13341322

13351323
@Override
1336-
public void setWantClientAuth(boolean b) {
1337-
1338-
}
1324+
public void setWantClientAuth(boolean b) {}
13391325

13401326
@Override
13411327
public boolean getWantClientAuth() {
13421328
return false;
13431329
}
13441330

13451331
@Override
1346-
public void setEnableSessionCreation(boolean b) {
1347-
1348-
}
1332+
public void setEnableSessionCreation(boolean b) {}
13491333

13501334
@Override
13511335
public boolean getEnableSessionCreation() {
@@ -1387,29 +1371,23 @@ public long getLastAccessedTime() {
13871371
}
13881372

13891373
@Override
1390-
public void invalidate() {
1391-
1392-
}
1374+
public void invalidate() {}
13931375

13941376
@Override
13951377
public boolean isValid() {
13961378
return false;
13971379
}
13981380

13991381
@Override
1400-
public void putValue(String s, Object o) {
1401-
1402-
}
1382+
public void putValue(String s, Object o) {}
14031383

14041384
@Override
14051385
public Object getValue(String s) {
14061386
return null;
14071387
}
14081388

14091389
@Override
1410-
public void removeValue(String s) {
1411-
1412-
}
1390+
public void removeValue(String s) {}
14131391

14141392
@Override
14151393
public String[] getValueNames() {

netty/src/test/java/io/grpc/netty/NettyClientTransportTest.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,14 +1271,10 @@ static class FakeClientTransportListener implements ManagedClientTransport.Liste
12711271
private boolean isConnected = false;
12721272

12731273
@Override
1274-
public void transportShutdown(Status s) {
1275-
1276-
}
1274+
public void transportShutdown(Status s) {}
12771275

12781276
@Override
1279-
public void transportTerminated() {
1280-
1281-
}
1277+
public void transportTerminated() {}
12821278

12831279
@Override
12841280
public void transportReady() {
@@ -1289,9 +1285,7 @@ public void transportReady() {
12891285
}
12901286

12911287
@Override
1292-
public void transportInUse(boolean inUse) {
1293-
1294-
}
1288+
public void transportInUse(boolean inUse) {}
12951289
}
12961290

12971291
private class FakeTrustManager implements X509TrustManager {

0 commit comments

Comments
 (0)