Community
Participate
Working Groups
Version: 3.2.0 Build id: I20060208-0848 Given the following code sample, the second reference to value is flagged as a possible null reference. public void nullTest(String value) { assert(value != null); assert(value.length() > 0); } I am not 100% sure this is a bug or not as assertions have to be enabled at runtime to prevent the NullPointerException, but the programmer has asserted that value should not be null at the second line.
Likely a good pattern to recognize in presence of assign statements.
FYI: IDEA recognises assert statements and even offers their equivalent of "quick fixes" that will insert assert statements to get rid of those "The value might be null" warnings.
Created attachment 34901 [details] Tentative implementation + test cases See NullReferenceTest tests 950 and following.
Fixed and released in HEAD.
*** Bug 128943 has been marked as a duplicate of this bug. ***
Verified for 3.2 M6 using warm-up build I20060327-0010.