Bug 513639 - [null][correlation] False Positive in Null Analysis
Summary: [null][correlation] False Positive in Null Analysis
Status: CLOSED DUPLICATE of bug 538421
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.7 M7   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2017-03-14 08:10 EDT by Christian Dietrich CLA
Modified: 2018-08-30 10:24 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Dietrich CLA 2017-03-14 08:10:10 EDT
Following Snippet gives a wrong positive in null analysis

	public static void mainx(String xxxx) {
		boolean b = xxxx==null;
		if (b) {
			System.out.println("a");
		} else {
			System.out.println(xxxx.toString());
		}
	}
Comment 1 Stephan Herrmann CLA 2017-03-14 08:44:38 EDT
Hi Christian,

I understand your expectation, but unfortunately, what you want requires more than a regular compiler. A theorem prover / deduction engine _might_ be capable of "understanding" your example, but ecj under the given constraints has no knowledge about the correlation between b and xxxx.

See also bug 290263 comment 5.

*** This bug has been marked as a duplicate of bug 290263 ***
Comment 2 Stephan Herrmann CLA 2018-08-30 10:24:51 EDT

*** This bug has been marked as a duplicate of bug 538421 ***