asbachb commented on issue #6149:
URL: https://github.com/apache/netbeans/issues/6149#issuecomment-1627484452
Here's an additional test for `NPECheckTest` to prove the problem:
```java
public void testObjectsRequireNonNull() throws Exception {
HintTest.create()
.input("package test;\n"
+ "import java.util.Objects;\n"
+ "public class Test {\n"
+ " public String test(Object obj) {\n"
+ " Objects.requireNonNull(obj);\n"
+ " if (obj instanceof Number)\n"
+ " return \"\";\n"
+ ""
+ " return obj.toString();\n"
+ " }\n"
+ "}")
.run(NPECheck.class)
.assertNotContainsWarnings("7:15-7:23:verifier:Possibly
Dereferencing null");
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists