-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[BUG] @NonNull on a primitive array field on a record isn't working #3366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It works as expected if you annotated the method parameter and not the array type e.g. It seems odd to me that it works at all (e.g. for normal methods) but there's probably a good reason I can't figure out. |
IMO the meaning should be:
For primitives, the second case is obviously irrelevant. So I think Lombok is wrong here. But: That is only true if it's a type annotation and not a parameter annotation. Lombok's |
Available on edge. |
Describe the bug
@ NonNull on a primitive array field on a record isn't working
To Reproduce
NamedByteArray.java
NamedByteArrayTest.java
Expected behavior
@nonnull should throws NPE on primitive array field on a record if it is null.
Version info:
Additional information:
If you decompile the NamedByteArray.class:
The text was updated successfully, but these errors were encountered: