Skip to content

Commit f5b976d

Browse files
committed
stub: Remove useless private method indirection
The method did nothing; just inline its contents. Brought up as part of #7173's review.
1 parent e2de5f1 commit f5b976d

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

stub/src/main/java/io/grpc/stub/ServerCalls.java

+4-24
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private ServerCalls() {
4848
*/
4949
public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncUnaryCall(
5050
UnaryMethod<ReqT, RespT> method) {
51-
return asyncUnaryRequestCall(method);
51+
return new UnaryServerCallHandler<>(method);
5252
}
5353

5454
/**
@@ -58,7 +58,7 @@ public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncUnaryCall(
5858
*/
5959
public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncServerStreamingCall(
6060
ServerStreamingMethod<ReqT, RespT> method) {
61-
return asyncUnaryRequestCall(method);
61+
return new UnaryServerCallHandler<>(method);
6262
}
6363

6464
/**
@@ -68,7 +68,7 @@ public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncServerStreamingC
6868
*/
6969
public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncClientStreamingCall(
7070
ClientStreamingMethod<ReqT, RespT> method) {
71-
return asyncStreamingRequestCall(method);
71+
return new StreamingServerCallHandler<>(method);
7272
}
7373

7474
/**
@@ -78,7 +78,7 @@ public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncClientStreamingC
7878
*/
7979
public static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncBidiStreamingCall(
8080
BidiStreamingMethod<ReqT, RespT> method) {
81-
return asyncStreamingRequestCall(method);
81+
return new StreamingServerCallHandler<>(method);
8282
}
8383

8484
/**
@@ -205,16 +205,6 @@ public void onReady() {
205205
}
206206
}
207207

208-
/**
209-
* Creates a {@link ServerCallHandler} for a unary request call method of the service.
210-
*
211-
* @param method an adaptor to the actual method on the service implementation.
212-
*/
213-
private static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncUnaryRequestCall(
214-
UnaryRequestMethod<ReqT, RespT> method) {
215-
return new UnaryServerCallHandler<>(method);
216-
}
217-
218208
private static final class StreamingServerCallHandler<ReqT, RespT>
219209
implements ServerCallHandler<ReqT, RespT> {
220210

@@ -293,16 +283,6 @@ public void onReady() {
293283
}
294284
}
295285

296-
/**
297-
* Creates a {@link ServerCallHandler} for a streaming request call method of the service.
298-
*
299-
* @param method an adaptor to the actual method on the service implementation.
300-
*/
301-
private static <ReqT, RespT> ServerCallHandler<ReqT, RespT> asyncStreamingRequestCall(
302-
StreamingRequestMethod<ReqT, RespT> method) {
303-
return new StreamingServerCallHandler<>(method);
304-
}
305-
306286
private interface UnaryRequestMethod<ReqT, RespT> {
307287
/**
308288
* The provided {@code responseObserver} will extend {@link ServerCallStreamObserver}.

0 commit comments

Comments
 (0)