Change AbstractServiceDescriptor.methods() to Collection. Resolves #573
diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp
index 3d0da66..5795157 100644
--- a/compiler/src/java_plugin/cpp/java_generator.cpp
+++ b/compiler/src/java_plugin/cpp/java_generator.cpp
@@ -204,7 +204,7 @@
p->Print(
*vars,
"@$Override$\n"
- "public $ImmutableList$<$MethodDescriptor$<?, ?>> methods() {\n");
+ "public $Collection$<$MethodDescriptor$<?, ?>> methods() {\n");
p->Indent();
p->Print(
*vars,
@@ -674,6 +674,7 @@
vars["AbstractServiceDescriptor"] =
"io.grpc.stub.AbstractServiceDescriptor";
vars["ImmutableList"] = "com.google.common.collect.ImmutableList";
+ vars["Collection"] = "java.util.Collection";
vars["MethodDescriptor"] = "io.grpc.MethodDescriptor";
vars["ProtoUtils"] = "io.grpc.protobuf.ProtoUtils";
vars["NanoUtils"] = "io.grpc.protobuf.nano.NanoUtils";
diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt
index cb3baf6..a8b4f47 100644
--- a/compiler/src/test/golden/TestService.java.txt
+++ b/compiler/src/test/golden/TestService.java.txt
@@ -121,7 +121,7 @@
}
@java.lang.Override
- public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
+ public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
unaryCall,
streamingOutputCall,
diff --git a/compiler/src/test/golden/TestServiceNano.java.txt b/compiler/src/test/golden/TestServiceNano.java.txt
index a75422d..114f671 100644
--- a/compiler/src/test/golden/TestServiceNano.java.txt
+++ b/compiler/src/test/golden/TestServiceNano.java.txt
@@ -183,7 +183,7 @@
}
@java.lang.Override
- public com.google.common.collect.ImmutableList<io.grpc.MethodDescriptor<?, ?>> methods() {
+ public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
unaryCall,
streamingOutputCall,