Skip to content

Commit f8700a1

Browse files
authored
compiler: Default to @generated=omit (#12080)
After many years of issue 9179 being open, there's been nothing to show that we need the javax.annotations.Generated annotation. Most tools use file paths and a few check for annotations with "Generated" in the name. ErrorProne has a few that check for javax.annotations.Generated, but only UnnecessarilyFullyQualified looks like it'd be a problem and it is disabled by default. We're not getting any more information, no users have reported issues with `@generated=omit`, and the existing dependency is annoying users, so just drop it. Given we will still retain the GrpcGenerated annotation, it seems highly likely things are already okay. Even if there are problems they would probably be addressed by adding a io.grpc.stub.annotations.Generated annotation or small tweaks. In the short-term, (non-Bazel) users can use `@generated=javax`, but long-term we could consider removing the option assuming we've resolved any outstanding issues. We will want to update the examples and the README to remove the org.apache.tomcat:annotations-api dependency after the next release. Fixes #9179
1 parent 2fb0957 commit f8700a1

File tree

49 files changed

+6
-145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6
-145
lines changed

BUILD.bazel

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ java_library(
3333
"//api",
3434
"//protobuf",
3535
"//stub",
36-
"//stub:javax_annotation",
3736
"@com_google_protobuf//:protobuf_java",
3837
artifact("com.google.code.findbugs:jsr305"),
3938
artifact("com.google.guava:guava"),
@@ -47,7 +46,6 @@ java_library(
4746
"//api",
4847
"//protobuf-lite",
4948
"//stub",
50-
"//stub:javax_annotation",
5149
artifact("com.google.code.findbugs:jsr305"),
5250
artifact("com.google.guava:guava"),
5351
],
@@ -67,6 +65,5 @@ java_library(
6765
visibility = ["//:__subpackages__"],
6866
exports = [
6967
artifact("com.google.auto.value:auto-value-annotations"),
70-
artifact("org.apache.tomcat:annotations-api"), # @Generated for Java 9+
7168
],
7269
)

MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
4141
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
4242
"io.perfmark:perfmark-api:0.27.0",
4343
"junit:junit:4.13.2",
44-
"org.apache.tomcat:annotations-api:6.0.53",
4544
"org.checkerframework:checker-qual:3.12.0",
4645
"org.codehaus.mojo:animal-sniffer-annotations:1.24",
4746
]

alts/src/generated/main/grpc/io/grpc/alts/internal/HandshakerServiceGrpc.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
/**
66
*/
7-
@javax.annotation.Generated(
8-
value = "by gRPC proto compiler",
9-
comments = "Source: grpc/gcp/handshaker.proto")
107
@io.grpc.stub.annotations.GrpcGenerated
118
public final class HandshakerServiceGrpc {
129

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/LoadBalancerStatsServiceGrpc.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
* A service used to obtain stats for verifying LB behavior.
88
* </pre>
99
*/
10-
@javax.annotation.Generated(
11-
value = "by gRPC proto compiler",
12-
comments = "Source: grpc/testing/test.proto")
1310
@io.grpc.stub.annotations.GrpcGenerated
1411
public final class LoadBalancerStatsServiceGrpc {
1512

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/MetricsServiceGrpc.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
/**
66
*/
7-
@javax.annotation.Generated(
8-
value = "by gRPC proto compiler",
9-
comments = "Source: grpc/testing/metrics.proto")
107
@io.grpc.stub.annotations.GrpcGenerated
118
public final class MetricsServiceGrpc {
129

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/ReconnectServiceGrpc.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
* A service used to control reconnect server.
88
* </pre>
99
*/
10-
@javax.annotation.Generated(
11-
value = "by gRPC proto compiler",
12-
comments = "Source: grpc/testing/test.proto")
1310
@io.grpc.stub.annotations.GrpcGenerated
1411
public final class ReconnectServiceGrpc {
1512

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/TestServiceGrpc.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
* performance with various types of payload.
99
* </pre>
1010
*/
11-
@javax.annotation.Generated(
12-
value = "by gRPC proto compiler",
13-
comments = "Source: grpc/testing/test.proto")
1411
@io.grpc.stub.annotations.GrpcGenerated
1512
public final class TestServiceGrpc {
1613

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/UnimplementedServiceGrpc.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
* that case.
99
* </pre>
1010
*/
11-
@javax.annotation.Generated(
12-
value = "by gRPC proto compiler",
13-
comments = "Source: grpc/testing/test.proto")
1411
@io.grpc.stub.annotations.GrpcGenerated
1512
public final class UnimplementedServiceGrpc {
1613

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateClientConfigureServiceGrpc.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
* A service to dynamically update the configuration of an xDS test client.
88
* </pre>
99
*/
10-
@javax.annotation.Generated(
11-
value = "by gRPC proto compiler",
12-
comments = "Source: grpc/testing/test.proto")
1310
@io.grpc.stub.annotations.GrpcGenerated
1411
public final class XdsUpdateClientConfigureServiceGrpc {
1512

android-interop-testing/src/generated/debug/grpc/io/grpc/testing/integration/XdsUpdateHealthServiceGrpc.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
* A service to remotely control health status of an xDS test server.
88
* </pre>
99
*/
10-
@javax.annotation.Generated(
11-
value = "by gRPC proto compiler",
12-
comments = "Source: grpc/testing/test.proto")
1310
@io.grpc.stub.annotations.GrpcGenerated
1411
public final class XdsUpdateHealthServiceGrpc {
1512

0 commit comments

Comments
 (0)