This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In the following code: @NotNull Foo s = new Foo(); if (s.fieldName == null) { ... } The expression `s.fieldName == null` is given the incorrect hint "Unnecessary test for null - the expression is never null". The class Foo is defined as follows: public class Foo { @Nullable public Object fieldName; } The @NotNull and @Nullable interfaces are defined in the same package as follows. @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface NotNull { } @java.lang.annotation.Documented @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.FIELD, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.LOCAL_VARIABLE}) public @interface Nullable { }
*** Bug 228590 has been marked as a duplicate of this bug. ***
Same as bug #228239, as far as I can tell.