Bug 155769

Summary: [compiler][null] the filtering of problems of different severities should be controlled by different settings
Product: [Eclipse Project] JDT Reporter: Shawn Lauzon <lauzon>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: amj87.iitr, mlists, stephan.herrmann
Version: 3.2   
Target Milestone: 3.3 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Shawn Lauzon CLA 2006-08-31 03:30:13 EDT
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.
Comment 1 Maxime Daniel CLA 2006-08-31 05:04:43 EDT
Philippe, what do you think?
Comment 2 Maxime Daniel CLA 2006-12-05 03:02:23 EST
Removed the blocking of the null analysis improvements 'umbrella bug'.
Comment 3 Stephan Herrmann CLA 2012-06-23 09:29:42 EDT
Apparently this has been fixed time ago.

*** This bug has been marked as a duplicate of bug 170704 ***
Comment 4 Ayushman Jain CLA 2012-08-07 02:45:44 EDT
Verified that the null analysis options are all configurable in build I20120806-2000.