From c2d1d8383acd96b58d6cc01282845b327c1f6ed4 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Wed, 1 Jul 2020 11:03:25 -0700 Subject: [PATCH] stub: Remove useless private method indirection The method did nothing; just inline its contents. Brought up as part of #7173's review. --- .../main/java/io/grpc/stub/ServerCalls.java | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/stub/src/main/java/io/grpc/stub/ServerCalls.java b/stub/src/main/java/io/grpc/stub/ServerCalls.java index f3f8cd7470e..bb9720984dd 100644 --- a/stub/src/main/java/io/grpc/stub/ServerCalls.java +++ b/stub/src/main/java/io/grpc/stub/ServerCalls.java @@ -48,7 +48,7 @@ private ServerCalls() { */ public static ServerCallHandler asyncUnaryCall( UnaryMethod method) { - return asyncUnaryRequestCall(method); + return new UnaryServerCallHandler<>(method); } /** @@ -58,7 +58,7 @@ public static ServerCallHandler asyncUnaryCall( */ public static ServerCallHandler asyncServerStreamingCall( ServerStreamingMethod method) { - return asyncUnaryRequestCall(method); + return new UnaryServerCallHandler<>(method); } /** @@ -68,7 +68,7 @@ public static ServerCallHandler asyncServerStreamingC */ public static ServerCallHandler asyncClientStreamingCall( ClientStreamingMethod method) { - return asyncStreamingRequestCall(method); + return new StreamingServerCallHandler<>(method); } /** @@ -78,7 +78,7 @@ public static ServerCallHandler asyncClientStreamingC */ public static ServerCallHandler asyncBidiStreamingCall( BidiStreamingMethod method) { - return asyncStreamingRequestCall(method); + return new StreamingServerCallHandler<>(method); } /** @@ -205,16 +205,6 @@ public void onReady() { } } - /** - * Creates a {@link ServerCallHandler} for a unary request call method of the service. - * - * @param method an adaptor to the actual method on the service implementation. - */ - private static ServerCallHandler asyncUnaryRequestCall( - UnaryRequestMethod method) { - return new UnaryServerCallHandler<>(method); - } - private static final class StreamingServerCallHandler implements ServerCallHandler { @@ -293,16 +283,6 @@ public void onReady() { } } - /** - * Creates a {@link ServerCallHandler} for a streaming request call method of the service. - * - * @param method an adaptor to the actual method on the service implementation. - */ - private static ServerCallHandler asyncStreamingRequestCall( - StreamingRequestMethod method) { - return new StreamingServerCallHandler<>(method); - } - private interface UnaryRequestMethod { /** * The provided {@code responseObserver} will extend {@link ServerCallStreamObserver}.