Summary: | Wrong code generation for comparison of string constants | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Olivier Thomann <Olivier_Thomann> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | critical | ||
Priority: | P1 | ||
Version: | 2.0 | ||
Target Milestone: | 2.0 M3 | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: |
Description
Olivier Thomann
2002-02-06 10:30:05 EST
The bug is really simple. It comes from the: public boolean compileTimeEqual(StringConstant right){...} method on StringConstant. This method always returns true. But it should do: public boolean compileTimeEqual(StringConstant right){ //String are intermed in the compiler==>thus if two string constant //get to be compared, it is an equal on the vale which is done if (this.value == null) { return right.value == null; } return this.value.equals(right.value); } If I changed that, the test case is compiled and executed without a problem. Fix released in HEAD and regression test added. Backported to 1.0 stream (rollup2) Verified and added test case (see ConformTest.test108). Verified with official rollup2. |