diff --git a/compiler/src/java_plugin/cpp/java_plugin.cpp b/compiler/src/java_plugin/cpp/java_plugin.cpp
index 9765fa70a9..4789df225e 100644
--- a/compiler/src/java_plugin/cpp/java_plugin.cpp
+++ b/compiler/src/java_plugin/cpp/java_plugin.cpp
@@ -38,8 +38,7 @@ class JavaGrpcGenerator : public google::protobuf::compiler::CodeGenerator {
java_grpc_generator::ProtoFlavor flavor =
java_grpc_generator::ProtoFlavor::NORMAL;
- // TODO(zdapeng): turn the default value to false
- bool enable_deprecated = true;
+ bool enable_deprecated = false;
for (int i = 0; i < options.size(); i++) {
if (options[i].first == "nano") {
flavor = java_grpc_generator::ProtoFlavor::NANO;
diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt
index 57747151e6..bfb74dfef3 100644
--- a/compiler/src/test/golden/TestService.java.txt
+++ b/compiler/src/test/golden/TestService.java.txt
@@ -104,7 +104,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static abstract class TestServiceImplBase implements io.grpc.BindableService, TestService {
+ public static abstract class TestServiceImplBase implements io.grpc.BindableService {
/**
*
@@ -112,7 +112,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_UNARY_CALL, responseObserver);
@@ -124,7 +123,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_STREAMING_OUTPUT_CALL, responseObserver);
@@ -136,7 +134,6 @@ public class TestServiceGrpc {
* The server returns the aggregated size of client payload as the result.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver streamingInputCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_STREAMING_INPUT_CALL, responseObserver);
@@ -149,7 +146,6 @@ public class TestServiceGrpc {
* demonstrates the idea of full bidirectionality.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver fullBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_FULL_BIDI_CALL, responseObserver);
@@ -163,7 +159,6 @@ public class TestServiceGrpc {
* first request.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver halfBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_HALF_BIDI_CALL, responseObserver);
@@ -215,8 +210,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceStub extends io.grpc.stub.AbstractStub
- implements TestService {
+ public static final class TestServiceStub extends io.grpc.stub.AbstractStub {
private TestServiceStub(io.grpc.Channel channel) {
super(channel);
}
@@ -238,7 +232,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
@@ -251,7 +244,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncServerStreamingCall(
@@ -264,7 +256,6 @@ public class TestServiceGrpc {
* The server returns the aggregated size of client payload as the result.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver streamingInputCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncClientStreamingCall(
@@ -278,7 +269,6 @@ public class TestServiceGrpc {
* demonstrates the idea of full bidirectionality.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver fullBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
@@ -293,7 +283,6 @@ public class TestServiceGrpc {
* first request.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver halfBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
@@ -306,8 +295,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub
- implements TestServiceBlockingClient {
+ public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractStub {
private TestServiceBlockingStub(io.grpc.Channel channel) {
super(channel);
}
@@ -329,7 +317,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
return blockingUnaryCall(
getChannel(), METHOD_UNARY_CALL, getCallOptions(), request);
@@ -341,7 +328,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public java.util.Iterator streamingOutputCall(
io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
return blockingServerStreamingCall(
@@ -354,8 +340,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub
- implements TestServiceFutureClient {
+ public static final class TestServiceFutureStub extends io.grpc.stub.AbstractStub {
private TestServiceFutureStub(io.grpc.Channel channel) {
super(channel);
}
@@ -377,7 +362,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public com.google.common.util.concurrent.ListenableFuture unaryCall(
io.grpc.testing.integration.Test.SimpleRequest request) {
return futureUnaryCall(
@@ -385,165 +369,6 @@ public class TestServiceGrpc {
}
}
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestService {
-
- public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
- io.grpc.stub.StreamObserver responseObserver);
-
- public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver streamingInputCall(
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver fullBidiCall(
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver halfBidiCall(
- io.grpc.stub.StreamObserver responseObserver);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestServiceBlockingClient {
-
- public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
-
- public java.util.Iterator streamingOutputCall(
- io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestServiceFutureClient {
-
- public com.google.common.util.concurrent.ListenableFuture unaryCall(
- io.grpc.testing.integration.Test.SimpleRequest request);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static abstract class AbstractTestService extends TestServiceImplBase {}
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService(final TestService serviceImpl) {
- return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
- .addMethod(
- METHOD_UNARY_CALL,
- asyncUnaryCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.SimpleRequest,
- io.grpc.testing.integration.Test.SimpleResponse>(
- serviceImpl, METHODID_UNARY_CALL)))
- .addMethod(
- METHOD_STREAMING_OUTPUT_CALL,
- asyncServerStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_STREAMING_OUTPUT_CALL)))
- .addMethod(
- METHOD_STREAMING_INPUT_CALL,
- asyncClientStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.StreamingInputCallRequest,
- io.grpc.testing.integration.Test.StreamingInputCallResponse>(
- serviceImpl, METHODID_STREAMING_INPUT_CALL)))
- .addMethod(
- METHOD_FULL_BIDI_CALL,
- asyncBidiStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_FULL_BIDI_CALL)))
- .addMethod(
- METHOD_HALF_BIDI_CALL,
- asyncBidiStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_HALF_BIDI_CALL)))
- .build();
- }
-
private static final int METHODID_UNARY_CALL = 0;
private static final int METHODID_STREAMING_OUTPUT_CALL = 1;
private static final int METHODID_STREAMING_INPUT_CALL = 2;
@@ -555,10 +380,10 @@ public class TestServiceGrpc {
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
- private final TestService serviceImpl;
+ private final TestServiceImplBase serviceImpl;
private final int methodId;
- public MethodHandlers(TestService serviceImpl, int methodId) {
+ public MethodHandlers(TestServiceImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
diff --git a/compiler/src/testLite/golden/TestService.java.txt b/compiler/src/testLite/golden/TestService.java.txt
index 7637f077b5..996c5d35d7 100644
--- a/compiler/src/testLite/golden/TestService.java.txt
+++ b/compiler/src/testLite/golden/TestService.java.txt
@@ -104,7 +104,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static abstract class TestServiceImplBase implements io.grpc.BindableService, TestService {
+ public static abstract class TestServiceImplBase implements io.grpc.BindableService {
/**
*
@@ -112,7 +112,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_UNARY_CALL, responseObserver);
@@ -124,7 +123,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_STREAMING_OUTPUT_CALL, responseObserver);
@@ -136,7 +134,6 @@ public class TestServiceGrpc {
* The server returns the aggregated size of client payload as the result.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver streamingInputCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_STREAMING_INPUT_CALL, responseObserver);
@@ -149,7 +146,6 @@ public class TestServiceGrpc {
* demonstrates the idea of full bidirectionality.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver fullBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_FULL_BIDI_CALL, responseObserver);
@@ -163,7 +159,6 @@ public class TestServiceGrpc {
* first request.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver halfBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_HALF_BIDI_CALL, responseObserver);
@@ -215,8 +210,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceStub extends io.grpc.stub.AbstractStub
- implements TestService {
+ public static final class TestServiceStub extends io.grpc.stub.AbstractStub {
private TestServiceStub(io.grpc.Channel channel) {
super(channel);
}
@@ -238,7 +232,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
@@ -251,7 +244,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncServerStreamingCall(
@@ -264,7 +256,6 @@ public class TestServiceGrpc {
* The server returns the aggregated size of client payload as the result.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver streamingInputCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncClientStreamingCall(
@@ -278,7 +269,6 @@ public class TestServiceGrpc {
* demonstrates the idea of full bidirectionality.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver fullBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
@@ -293,7 +283,6 @@ public class TestServiceGrpc {
* first request.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver halfBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
@@ -306,8 +295,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub
- implements TestServiceBlockingClient {
+ public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractStub {
private TestServiceBlockingStub(io.grpc.Channel channel) {
super(channel);
}
@@ -329,7 +317,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
return blockingUnaryCall(
getChannel(), METHOD_UNARY_CALL, getCallOptions(), request);
@@ -341,7 +328,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public java.util.Iterator streamingOutputCall(
io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
return blockingServerStreamingCall(
@@ -354,8 +340,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub
- implements TestServiceFutureClient {
+ public static final class TestServiceFutureStub extends io.grpc.stub.AbstractStub {
private TestServiceFutureStub(io.grpc.Channel channel) {
super(channel);
}
@@ -377,7 +362,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public com.google.common.util.concurrent.ListenableFuture unaryCall(
io.grpc.testing.integration.Test.SimpleRequest request) {
return futureUnaryCall(
@@ -385,165 +369,6 @@ public class TestServiceGrpc {
}
}
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestService {
-
- public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
- io.grpc.stub.StreamObserver responseObserver);
-
- public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver streamingInputCall(
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver fullBidiCall(
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver halfBidiCall(
- io.grpc.stub.StreamObserver responseObserver);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestServiceBlockingClient {
-
- public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request);
-
- public java.util.Iterator streamingOutputCall(
- io.grpc.testing.integration.Test.StreamingOutputCallRequest request);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestServiceFutureClient {
-
- public com.google.common.util.concurrent.ListenableFuture unaryCall(
- io.grpc.testing.integration.Test.SimpleRequest request);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static abstract class AbstractTestService extends TestServiceImplBase {}
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService(final TestService serviceImpl) {
- return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
- .addMethod(
- METHOD_UNARY_CALL,
- asyncUnaryCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.SimpleRequest,
- io.grpc.testing.integration.Test.SimpleResponse>(
- serviceImpl, METHODID_UNARY_CALL)))
- .addMethod(
- METHOD_STREAMING_OUTPUT_CALL,
- asyncServerStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_STREAMING_OUTPUT_CALL)))
- .addMethod(
- METHOD_STREAMING_INPUT_CALL,
- asyncClientStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.StreamingInputCallRequest,
- io.grpc.testing.integration.Test.StreamingInputCallResponse>(
- serviceImpl, METHODID_STREAMING_INPUT_CALL)))
- .addMethod(
- METHOD_FULL_BIDI_CALL,
- asyncBidiStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_FULL_BIDI_CALL)))
- .addMethod(
- METHOD_HALF_BIDI_CALL,
- asyncBidiStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_HALF_BIDI_CALL)))
- .build();
- }
-
private static final int METHODID_UNARY_CALL = 0;
private static final int METHODID_STREAMING_OUTPUT_CALL = 1;
private static final int METHODID_STREAMING_INPUT_CALL = 2;
@@ -555,10 +380,10 @@ public class TestServiceGrpc {
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
- private final TestService serviceImpl;
+ private final TestServiceImplBase serviceImpl;
private final int methodId;
- public MethodHandlers(TestService serviceImpl, int methodId) {
+ public MethodHandlers(TestServiceImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
diff --git a/compiler/src/testNano/golden/TestService.java.txt b/compiler/src/testNano/golden/TestService.java.txt
index 9c0ac11de8..3296daf1ce 100644
--- a/compiler/src/testNano/golden/TestService.java.txt
+++ b/compiler/src/testNano/golden/TestService.java.txt
@@ -182,7 +182,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static abstract class TestServiceImplBase implements io.grpc.BindableService, TestService {
+ public static abstract class TestServiceImplBase implements io.grpc.BindableService {
/**
*
@@ -190,7 +190,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_UNARY_CALL, responseObserver);
@@ -202,7 +201,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_STREAMING_OUTPUT_CALL, responseObserver);
@@ -214,7 +212,6 @@ public class TestServiceGrpc {
* The server returns the aggregated size of client payload as the result.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver streamingInputCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_STREAMING_INPUT_CALL, responseObserver);
@@ -227,7 +224,6 @@ public class TestServiceGrpc {
* demonstrates the idea of full bidirectionality.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver fullBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_FULL_BIDI_CALL, responseObserver);
@@ -241,7 +237,6 @@ public class TestServiceGrpc {
* first request.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver halfBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_HALF_BIDI_CALL, responseObserver);
@@ -293,8 +288,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceStub extends io.grpc.stub.AbstractStub
- implements TestService {
+ public static final class TestServiceStub extends io.grpc.stub.AbstractStub {
private TestServiceStub(io.grpc.Channel channel) {
super(channel);
}
@@ -316,7 +310,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
@@ -329,7 +322,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncServerStreamingCall(
@@ -342,7 +334,6 @@ public class TestServiceGrpc {
* The server returns the aggregated size of client payload as the result.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver streamingInputCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncClientStreamingCall(
@@ -356,7 +347,6 @@ public class TestServiceGrpc {
* demonstrates the idea of full bidirectionality.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver fullBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
@@ -371,7 +361,6 @@ public class TestServiceGrpc {
* first request.
*
*/
- @java.lang.Override
public io.grpc.stub.StreamObserver halfBidiCall(
io.grpc.stub.StreamObserver responseObserver) {
return asyncBidiStreamingCall(
@@ -384,8 +373,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub
- implements TestServiceBlockingClient {
+ public static final class TestServiceBlockingStub extends io.grpc.stub.AbstractStub {
private TestServiceBlockingStub(io.grpc.Channel channel) {
super(channel);
}
@@ -407,7 +395,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request) {
return blockingUnaryCall(
getChannel(), METHOD_UNARY_CALL, getCallOptions(), request);
@@ -419,7 +406,6 @@ public class TestServiceGrpc {
* The server returns the payload with client desired type and sizes.
*
*/
- @java.lang.Override
public java.util.Iterator streamingOutputCall(
io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request) {
return blockingServerStreamingCall(
@@ -432,8 +418,7 @@ public class TestServiceGrpc {
* Test service that supports all call types.
*
*/
- public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub
- implements TestServiceFutureClient {
+ public static final class TestServiceFutureStub extends io.grpc.stub.AbstractStub {
private TestServiceFutureStub(io.grpc.Channel channel) {
super(channel);
}
@@ -455,7 +440,6 @@ public class TestServiceGrpc {
* The server returns the client payload as-is.
*
*/
- @java.lang.Override
public com.google.common.util.concurrent.ListenableFuture unaryCall(
io.grpc.testing.integration.nano.Test.SimpleRequest request) {
return futureUnaryCall(
@@ -463,165 +447,6 @@ public class TestServiceGrpc {
}
}
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestService {
-
- public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request,
- io.grpc.stub.StreamObserver responseObserver);
-
- public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver streamingInputCall(
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver fullBidiCall(
- io.grpc.stub.StreamObserver responseObserver);
-
- public io.grpc.stub.StreamObserver halfBidiCall(
- io.grpc.stub.StreamObserver responseObserver);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestServiceBlockingClient {
-
- public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request);
-
- public java.util.Iterator streamingOutputCall(
- io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static interface TestServiceFutureClient {
-
- public com.google.common.util.concurrent.ListenableFuture unaryCall(
- io.grpc.testing.integration.nano.Test.SimpleRequest request);
- }
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static abstract class AbstractTestService extends TestServiceImplBase {}
-
- /**
- * This will be removed in the next release.
- * If your code has been using gRPC-java v0.15.0 or higher already,
- * the following changes to your code are suggested:
- *
- * - replace {@code extends/implements TestService} with {@code extends TestServiceImplBase} for server side;
- * - replace {@code TestService} with {@code TestServiceStub} for client side;
- * - replace usage of {@code TestService} with {@code TestServiceImplBase};
- * - replace usage of {@code AbstractTestService} with {@link TestServiceImplBase};
- * - replace {@code serverBuilder.addService(TestServiceGrpc.bindService(serviceImpl))}
- * with {@code serverBuilder.addService(serviceImpl)};
- * - if you are mocking stubs using mockito, please do not mock them.
- * See the documentation on testing with gRPC-java;
- * - replace {@code TestServiceBlockingClient} with {@link TestServiceBlockingStub};
- * - replace {@code TestServiceFutureClient} with {@link TestServiceFutureStub}.
- *
- */
- @java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService(final TestService serviceImpl) {
- return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
- .addMethod(
- METHOD_UNARY_CALL,
- asyncUnaryCall(
- new MethodHandlers<
- io.grpc.testing.integration.nano.Test.SimpleRequest,
- io.grpc.testing.integration.nano.Test.SimpleResponse>(
- serviceImpl, METHODID_UNARY_CALL)))
- .addMethod(
- METHOD_STREAMING_OUTPUT_CALL,
- asyncServerStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_STREAMING_OUTPUT_CALL)))
- .addMethod(
- METHOD_STREAMING_INPUT_CALL,
- asyncClientStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.nano.Test.StreamingInputCallRequest,
- io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>(
- serviceImpl, METHODID_STREAMING_INPUT_CALL)))
- .addMethod(
- METHOD_FULL_BIDI_CALL,
- asyncBidiStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_FULL_BIDI_CALL)))
- .addMethod(
- METHOD_HALF_BIDI_CALL,
- asyncBidiStreamingCall(
- new MethodHandlers<
- io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(
- serviceImpl, METHODID_HALF_BIDI_CALL)))
- .build();
- }
-
private static final int METHODID_UNARY_CALL = 0;
private static final int METHODID_STREAMING_OUTPUT_CALL = 1;
private static final int METHODID_STREAMING_INPUT_CALL = 2;
@@ -633,10 +458,10 @@ public class TestServiceGrpc {
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
- private final TestService serviceImpl;
+ private final TestServiceImplBase serviceImpl;
private final int methodId;
- public MethodHandlers(TestService serviceImpl, int methodId) {
+ public MethodHandlers(TestServiceImplBase serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}