Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 386355

Summary: [null][correlation] Unexpected null access warning
Product: [Eclipse Project] JDT Reporter: John Arthorne <john.arthorne>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: stephan.herrmann
Version: 4.2Keywords: helpwanted
Target Milestone: 4.7 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description John Arthorne CLA 2012-07-31 16:53:57 EDT
This snippet reports a potential null access on s.toString() but it is not possible:

	public void testNull(boolean value) {
		String s = value ? "hello" : null;
		if (value)
			System.out.println(s.toString());
	}

Maybe similar to bug 354573 but simpler test case.
Comment 1 Stephan Herrmann CLA 2012-07-31 18:10:24 EDT
Thanks, John, for the test.

Please note that we have no plans (nor resources) to add correlation analysis.
Comment 2 Stephan Herrmann CLA 2016-06-28 17:16:57 EDT
Bulk closing all compiler bugs tagged [null][correlation], because we have no plans to add such a feature: it would be a tremendous implementation effort, beyond our current man power, and may be impossible to achieve within the desired performance bounds.

If s.o. has a viable strategy or even implementation for such a feature, I'm all ears.
Comment 3 Jay Arthanareeswaran CLA 2016-08-03 07:57:49 EDT
Verified for 4.7 M1.
Comment 4 Stephan Herrmann CLA 2018-08-30 10:34:09 EDT
I created a new umbrella RFE outlining what would be needed to address this issue.

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