Prevent construction of container classes and reduce API
diff --git a/compiler/src/java_plugin/cpp/java_generator.cpp b/compiler/src/java_plugin/cpp/java_generator.cpp
index f107798..0c33201 100644
--- a/compiler/src/java_plugin/cpp/java_generator.cpp
+++ b/compiler/src/java_plugin/cpp/java_generator.cpp
@@ -511,6 +511,9 @@
"@$Generated$(\"by gRPC proto compiler\")\n"
"public class $service_class_name$ {\n\n");
p->Indent();
+ p->Print(
+ *vars,
+ "private $service_class_name$() {}\n\n");
p->Print(
*vars,
diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt
index 7f5f4d4..66021a7 100644
--- a/compiler/src/test/golden/TestService.java.txt
+++ b/compiler/src/test/golden/TestService.java.txt
@@ -16,6 +16,8 @@
@javax.annotation.Generated("by gRPC proto compiler")
public class TestServiceGrpc {
+ private TestServiceGrpc() {}
+
public static final String SERVICE_NAME = "grpc.testing.TestService";
// Static method descriptors that strictly reflect the proto.
diff --git a/compiler/src/test/golden/TestServiceNano.java.txt b/compiler/src/test/golden/TestServiceNano.java.txt
index 0af54f2..ea6df13 100644
--- a/compiler/src/test/golden/TestServiceNano.java.txt
+++ b/compiler/src/test/golden/TestServiceNano.java.txt
@@ -18,6 +18,8 @@
@javax.annotation.Generated("by gRPC proto compiler")
public class TestServiceGrpc {
+ private TestServiceGrpc() {}
+
public static final String SERVICE_NAME = "grpc.testing.TestService";
// Static method descriptors that strictly reflect the proto.