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
{{ message }}
Repository navigation
JSpecify: Propagate nullability annotations to mapper implementation #4076
While trying the latest beta I've noticed that IDE adds a Overriding method parameters are not annotated warning to all null marked mappers because the generated implementations don't include any annotation at all:
Thanks for the feedback @RaniAgus. It's extremely valuable. This is indeed similar with #4036. However, that one is for the helper methods that we generate. I'll keep both and try to look for a potential solution to pass the annotations. My goal is to have no warnings from the tools, to truly be native to the use of JSpecify
Activity
RaniAgus commentedon Jun 28, 2026
Oops, might be related to #4036
filiphr commentedon Jun 28, 2026
Thanks for the feedback @RaniAgus. It's extremely valuable. This is indeed similar with #4036. However, that one is for the helper methods that we generate. I'll keep both and try to look for a potential solution to pass the annotations. My goal is to have no warnings from the tools, to truly be native to the use of JSpecify
pkernevez commentedon Aug 4, 2026
As a temporary solution you can add
@AnnotateWith(NullMarked.class)to your mapper.pkernevez commentedon Aug 4, 2026
In my case the parameter never have annotations.
So the generated code is:
Instead of you sample:
Is there a reason to not replicate all the parameters annotations ? (included non JSpecify ones)
mapstruct#4076 Propagate JSpecify nullability annotations to the mapp…