Annotate method descritpor files in the generated code with ExperimentalApi
diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp
index 6152dc5..4d725ee 100644
--- a/compiler/src/java_plugin/cpp/java_generator.cpp
+++ b/compiler/src/java_plugin/cpp/java_generator.cpp
@@ -107,6 +107,7 @@
// share the same request or response messages.
p->Print(
*vars,
+ "@$ExperimentalApi$\n"
"public static final $MethodDescriptor$<$input_type$,\n"
" $output_type$> $method_field_name$ =\n"
" $MethodDescriptor$.create(\n"
@@ -132,6 +133,7 @@
} else {
p->Print(
*vars,
+ "@$ExperimentalApi$\n"
"public static final $MethodDescriptor$<$input_type$,\n"
" $output_type$> $method_field_name$ =\n"
" $MethodDescriptor$.create(\n"
@@ -623,6 +625,7 @@
"com.google.common.util.concurrent.ListenableFuture";
vars["CodedInputByteBufferNano"] =
"com.google.protobuf.nano.CodedInputByteBufferNano";
+ vars["ExperimentalApi"] = "io.grpc.ExperimentalApi";
Printer printer(out, '$');
string package_name = ServiceJavaPackage(service->file());
diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt
index 8bc7673..105aaba 100644
--- a/compiler/src/test/golden/TestService.java.txt
+++ b/compiler/src/test/golden/TestService.java.txt
@@ -17,6 +17,7 @@
public class TestServiceGrpc {
// Static method descriptors that strictly reflect the proto.
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
io.grpc.testing.integration.Test.SimpleResponse> METHOD_UNARY_CALL =
io.grpc.MethodDescriptor.create(
@@ -25,6 +26,7 @@
"grpc.testing.TestService", "UnaryCall"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.parser()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.parser()));
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
io.grpc.MethodDescriptor.create(
@@ -33,6 +35,7 @@
"grpc.testing.TestService", "StreamingOutputCall"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
io.grpc.MethodDescriptor.create(
@@ -41,6 +44,7 @@
"grpc.testing.TestService", "StreamingInputCall"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.parser()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.parser()));
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL =
io.grpc.MethodDescriptor.create(
@@ -49,6 +53,7 @@
"grpc.testing.TestService", "FullBidiCall"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL =
io.grpc.MethodDescriptor.create(
diff --git a/compiler/src/test/golden/TestServiceNano.java.txt b/compiler/src/test/golden/TestServiceNano.java.txt
index a98a80f..916fe6b 100644
--- a/compiler/src/test/golden/TestServiceNano.java.txt
+++ b/compiler/src/test/golden/TestServiceNano.java.txt
@@ -19,6 +19,7 @@
public class TestServiceGrpc {
// Static method descriptors that strictly reflect the proto.
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.SimpleRequest,
io.grpc.testing.integration.nano.Test.SimpleResponse> METHOD_UNARY_CALL =
io.grpc.MethodDescriptor.create(
@@ -39,6 +40,7 @@
return io.grpc.testing.integration.nano.Test.SimpleResponse.parseFrom(input);
}
}));
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
io.grpc.MethodDescriptor.create(
@@ -59,6 +61,7 @@
return io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse.parseFrom(input);
}
}));
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest,
io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
io.grpc.MethodDescriptor.create(
@@ -79,6 +82,7 @@
return io.grpc.testing.integration.nano.Test.StreamingInputCallResponse.parseFrom(input);
}
}));
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL =
io.grpc.MethodDescriptor.create(
@@ -99,6 +103,7 @@
return io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse.parseFrom(input);
}
}));
+ @io.grpc.ExperimentalApi
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL =
io.grpc.MethodDescriptor.create(