Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 227954 - Incorrect NPE warning
Incorrect NPE warning
Product: java
Classification: Unclassified
Component: Hints
PC Linux
: P3 (vote)
: 7.3.1
Assigned To: Jan Lahoda
: 228333 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2013-03-26 15:02 UTC by Jan Lahoda
Modified: 2013-05-09 14:59 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jan Lahoda 2013-03-26 15:02:30 UTC
Current trunk builds produce the NPE warning for code like this:
class Test {
    private static void test(@NullAllowed String str) {
        if (str != null && str.equals("${") && str.equals("{")) {
    @interface NullAllowed {}

The warning is on the second str.equals. Thanks to tzezula for the test case.
Comment 1 Jan Lahoda 2013-03-27 12:49:32 UTC
Comment 2 Jan Lahoda 2013-04-15 09:32:18 UTC
*** Bug 228333 has been marked as a duplicate of this bug. ***
Comment 3 Jiri Prox 2013-04-15 14:46:28 UTC
Comment 4 Jan Lahoda 2013-05-03 07:31:19 UTC
Comment 5 Quality Engineering 2013-05-05 00:26:08 UTC
Integrated into 'releases', will be available in build *201305042200* or newer. Wait for official and publicly available build.
User: Jan Lahoda <>
Log: #227954: being more careful about which hypothetical state should be cleared - only those that were introduced by the method's parameter should disappear

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo