Bug 322209 - "assert" triggers a warning about null when it shouldn't
Summary: "assert" triggers a warning about null when it shouldn't
Status: VERIFIED DUPLICATE of bug 173725
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-10 05:41 EDT by Dominik Stadler CLA
Modified: 2010-09-14 00:32 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 Dominik Stadler CLA 2010-08-10 05:41:20 EDT
Build Identifier: 3.6.0

The following piece of code reports a warning about null-access because it thinks "assert" always does the null-check. However if the code is run without "-ea" the null-check will be necessary.

	public void testNullWarning(String param) {
		assert param != null;

		if (param == null) {
			System.out.println(param);
		}
	}


Reproducible: Always
Comment 1 Ayushman Jain CLA 2010-08-10 05:55:17 EDT
This is intended behaviour and we dont want to change this. See also bug 198044 for detailed discussions on the same.

*** This bug has been marked as a duplicate of bug 173725 ***
Comment 2 Srikanth Sankaran CLA 2010-08-26 03:21:11 EDT
Verified for 3.6.1 RC2
Comment 3 Srikanth Sankaran CLA 2010-09-14 00:32:48 EDT
Verified for 3.7 M2