Bug 155769 - [compiler][null] the filtering of problems of different severities should be controlled by different settings
Summary: [compiler][null] the filtering of problems of different severities should be ...
Status: RESOLVED DUPLICATE of bug 170704
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-31 03:30 EDT by Shawn Lauzon CLA
Modified: 2012-08-07 02:45 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.