Community
Participate
Working Groups
I have the following option set to warning: Java -> Compiler -> Errors/Warnings -> Null references. A null reference warning appears in the following code, saying "The variable text may be null": boolean hasText = text != null && text.trim().length() != 0; boolean saveEnabled = hasText && !text.equals(savedText); // Warning here
*** Bug 150125 has been marked as a duplicate of this bug. ***
*** Bug 150133 has been marked as a duplicate of this bug. ***
*** Bug 150134 has been marked as a duplicate of this bug. ***
This is a variant of the case reported into bug 136676, with a slight complication (the boolean expression is composite). Will need to add this test case when addressing 136676. *** This bug has been marked as a duplicate of 136676 ***