Summary: | object += "string"; okay with javac but not JDT--JLS ambiguity? | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | derc |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | minor | ||
Priority: | P3 | ||
Version: | 2.1 | ||
Target Milestone: | 3.0 M2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
derc
2003-06-23 21:32:11 EDT
On the surface, both behaviors should be consistent (o+=s and o=o+s), but interestingly enough Jikes does agree with us. Need to investigate some more. I suspect javac got tweaked to accept this code, against the spec. Changing our behavior to accept object += string, on the basis that object=object+string is fine. Fixed Sincere apologies, but I just noticed in the JDK 1.4.2 release notes (http://java.sun.com/j2se/1.4.2/changes.html#javac) that Sun has changed javac to no longer allow this behavior: Bug 4642850 fixed: javac now correctly no longer allows "+=" string concatenation with an Object variable on the left-hand side. Please revert back to the original behavior. Thanks! Good find. I had only commented the Object check, will resurrect it. Thanks for reopening. Closing |