Replace javax.annotation.Generated with custom gRPC annotation
See original GitHub issueSince Java 9 dropped javax.annotation.Generated
users have had to explicitly depend on a dep (typically Tomcat’s annotation API) to get the annotation. It’d be nice not to need that the extra dep.
But even more important is that the removal of Generated from Java 9 upset the ecosystem as a whole and fragmented it so badly that I believe many tools are no longer assuming they can predict which annotation will be used and are heuristics like “is the annotation named ‘Generated’” to determine whether they should it as generated code.
If we do an investigation and find that indeed all the tools we may care about (linters, static analyzers, IDEs) are observing Generated annotations in any package, then we can make our own io.grpc.Generated
. Unfortunately, I expect the io.grpc.GrpcGenerated
annotation may not suffice because its name is not exactly “Generated.” We’ll also need to figure out what retention it needs.
Tools to investigate (off the top of my head): Error Prone, IntelliJ, Eclipse, Android linter, Find Bugs, Checkstyle. The tools to investigate should be those that may be used by gRPC users, not just those directly used by gRPC maintainers.
javax.annotation.processing.Generated
is not a relevant replacement; see #3633. I highly doubt jakarta.annotation.Generated
would ever be appropriate, even with it being the new home for the annotation; it’d only have an advantage if Nullable goes that way as well, which seems unlikely. But that’d also take investigation of Kotlin and other null-caring tools.
Issue Analytics
- State:
- Created a year ago
- Reactions:8
- Comments:7 (1 by maintainers)
Top GitHub Comments
FYI, I just tried upgrading a project from Spring Boot 2.7.4 to 3.0.0-M5.
One of the first issues I run into is:
Spring Boot 3 (Spring Framework 6) is moving to Jakarta EE 9 APIs (jakarta.) instead of EE 8 (javax.).
Depending on
javax.annotation:javax.annotation-api:1.3.2
seems to be a workaround.IMO, using eclipse-transformer is a workaround. gRPC should support EE9/EE10 too.