You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After javax.annotation.Generated was deprecated in Java 9, AutoValue and other users of GeneratedAnnotations started using the new javax.annotation.processing.Generated replacement if it was available (source version > 8), falling back to the deprecated one otherwise:
if sourceVersion > 8: javax.annotation.processing.Generated
else if in classpath: javax.annotation.Generated
However, it doesn't look for the new EE replacement, which was repackaged jakarta.annotation.Generated. Some users want to switch to that annotation when compiling for Java 8.
We could change GeneratedAnnotations to use the following logic:
if sourceVersion > 8: javax.annotation.processing.Generated
else if in classpath: jakarta.annotation.Generated // new
else if in classpath: javax.annotation.Generated
Alternatively, or in addition, we could add a supported option to each of our processors that lets users specify which @Generated annotation they want the processor to emit, which would let users override that default logic in case they want to emit a different one.
sourceversion > 8 is likely to be true in almost all compilations by this point, right? Especially for people that care about Jakarta.
Perhaps switch the conditions:
if in classpath: jakarta.annotation.Generated // new
else if sourceVersion > 8: javax.annotation.processing.Generated
else if in classpath: javax.annotation.Generated
After
javax.annotation.Generated
was deprecated in Java 9, AutoValue and other users ofGeneratedAnnotations
started using the newjavax.annotation.processing.Generated
replacement if it was available (source version > 8), falling back to the deprecated one otherwise:However, it doesn't look for the new EE replacement, which was repackaged
jakarta.annotation.Generated
. Some users want to switch to that annotation when compiling for Java 8.We could change
GeneratedAnnotations
to use the following logic:Alternatively, or in addition, we could add a supported option to each of our processors that lets users specify which
@Generated
annotation they want the processor to emit, which would let users override that default logic in case they want to emit a different one.[From a discussion with @suztomo.]
The text was updated successfully, but these errors were encountered: