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
I observed an unexpected behavior of null analysis on record class.
Phenomenon
null analysis is not reporting correctly for record class. The value in @Target of org.springframework.lang.NonNull are {ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}, but the annotation seems not correctly propagating to the accessor of record class. As a comparison I also defined a equivalent class, and the null analysis works fine.
Details:
Expected behavior
According to JEP 395, when set to the record component, the NonNull should be treated as applied to the accessor of record class.
If an annotation on a record component is applicable to a method declaration, then the annotation appears on the corresponding accessor method.
Env
Windows 10 22H2
VsCode 1.96.4
Amazon Corretto 21 21.0.6_7
Extension Pack for Java 0.29.0
Language Support for Java(TM) by Red Hat 1.39.0
I observed an unexpected behavior of null analysis on record class.
Phenomenon
null analysis is not reporting correctly for record class. The value in
@Target
of org.springframework.lang.NonNull are {ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}, but the annotation seems not correctly propagating to the accessor of record class. As a comparison I also defined a equivalent class, and the null analysis works fine.Details:
Expected behavior
According to JEP 395, when set to the record component, the NonNull should be treated as applied to the accessor of record class.
Env
Windows 10 22H2
VsCode 1.96.4
Amazon Corretto 21 21.0.6_7
Extension Pack for Java 0.29.0
Language Support for Java(TM) by Red Hat 1.39.0
Source code:
The text was updated successfully, but these errors were encountered: