Community
Participate
Working Groups
I20070320-0010 Currently, there are no quick fixes for null-related problems (null pointer access, potential NPE, redundant null checks. For (potential) NPE problems, the fix would be to add a null check. For redundant null checks, the fix would be to replace the check with true or false. Here's a testbed that produces all null-related problems we currently have: class Nullerei { void nullAccess(Object a, Object b) { a= null; a.hashCode(); } void potential(Object a, Object b) { if (a != null) { } a.hashCode(); if (b == null) { } b.hashCode(); } void redundantCheck(Object a, Object b) { a.hashCode(); if (a == null) { } a= null; if (a != null) { } a= null; if (a instanceof Integer) {} b= new Object(); if (b != null) { } b= null; b= null; if (b == null) { } } }
*** Bug 221152 has been marked as a duplicate of this bug. ***