Use new Immutables Jakarta style to generate jakarta annotations #283
Labels
code cleanup
Fix issues reported by Sonar or any other code analysis tools
Milestone
Immutables 2.10.0 adds the
jakarta
style in@Value.Style
. Setting this totrue
tells Immutables to usejakarta
packages instead ofjava
, which as far as I can tell mainly affects the annotations.See support generating jakarta annotations instead of javax in Immutables.
Also see the Value source code and search for "jakarta". As of this writing, the
jakarta
attribute is on line 1578 but this will probably change by the time anyone reads this.The javadoc description as of this writing is:
It seems like there should be some text after "it's just so that", i.e. like someone got distracted in the middle of a sentence but never finished it. But in any case, it causes Immutables to use Jakarta annotations instead of the javax (old JSR-305) ones. The net effect is that it removes a bunch of annotations such as
javax.annotation.CheckReturnValue
,javax.annotation.NotThreadSafe
, andjavax.annotation.ParametersAreNonnullByDefault
. The main one that remains isjakarta.annotation.Nullable
.But by making this change, we will avoid split-package issues with the Java module system. See Nicolais' excellent explanation on split packages for more details.
The text was updated successfully, but these errors were encountered: