Summary: | [compiler][null] False positives for "null comparison always yields false" after instanceof operation | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Daniel Lew <daniel.lew> |
Component: | Core | Assignee: | Maxime Daniel <maxime_daniel> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | ||
Version: | 3.3.1 | ||
Target Milestone: | 3.3 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Daniel Lew
2007-08-06 13:53:25 EDT
Reproduced, will investigate. Revisiting. If foo was null, then foo instanceof String would yield false, !(foo instanceof String) would yield true, and the second member of the || expression would not get evaluated at all. This is reflected by the message, which, for 3.4 M1, states that 'The variable foo cannot be null at that [the comparison] location' (instead of the 'foo must be null' that the bug submitter observed. Checked 3.3.1 again, which has the same behavior. I would contend that our current behavior is correct. Which already was the conclusion of bug 145202, of which this one happens to be a duplicate. *** This bug has been marked as a duplicate of bug 145202 *** |