Community
Participate
Working Groups
If I enable the "Null reference" warning, it flags the following two problems: void foo() { String bar1 = null; String bar2 = null; bar1.toString(); // Variable bar1 can only be null int c = 0; if (c == 0) { bar2 = "foo"; } bar2.toString(); // Variable bar2 may be null } The compiler KNOWS that the first one is an error, so I would like to mark the serverity as "Error". The compiler just thinks the second one is suspicious, so I would like to mark it as "Warning". However, since they are under a single compile option, I can't do this. There are other things this flag catches; basically I would like code that is definitely going to throw an NPE to be a separate option than simply suspicious code.
Philippe, what do you think?
Removed the blocking of the null analysis improvements 'umbrella bug'.
Apparently this has been fixed time ago. *** This bug has been marked as a duplicate of bug 170704 ***
Verified that the null analysis options are all configurable in build I20120806-2000.