Community
Participate
Working Groups
I20071204-1547 Given: package test; import java.util.ArrayList; public class Test1 { public void foo() { ArrayList list= new ArrayList(); while (bar()) { if (list != null && bar()) { list.add(null); } } if (list.isEmpty()) { } } private boolean bar() { return false; } } 1. Enable 'Potential null pointer access' warning 2. Enable 'Redundant null check' warning Is: A potential null pointer access warning at 'list.isEmpty()': The variable list may be null' Should: Redundant null check warning at 'list != null' check
I believe this is a variation on bug 190737. Thanks for the test case. I'll add it when we tackle the other bug. *** This bug has been marked as a duplicate of bug 190737 ***
Verified for 3.6M4 using Build id: I20091207-1800