Community
Participate
Working Groups
From bug 322001 comment 14: class Base { boolean equalTo(Object other) {return false;} } interface EqualityComparable<T> { boolean equalTo(T other); } public class SomeClass extends Base implements EqualityComparable<String> { public boolean equalTo(String other) { return true; } public static void main(String args[]) { new SomeClass().equalTo(args); } } The program above contains a name clash between the inherited method and the bridge method. Eclipse fails to report the name clash. The generated code fails at runtime instead with a CCE. javac has the same bug too.
(In reply to comment #0) > From bug 322001 comment 14: > javac has the same bug too. As of 7b138, javac7 does report the name clash, so eclipse needs to report too.
The patch posted for bug 334306, fixes this issues also. I'll close this as a duplicate of bug 334306 and add a junit for the comment# 0 test case. *** This bug has been marked as a duplicate of bug 334306 ***
Trying to verify this bug I can't find a version of ecj that actually exhibits the bug. Could you please advise how I could reproduce the bug to see what actually the fix fixed? $ java -jar ~/jdt/ecj-3.6.jar -version Eclipse Compiler for Java(TM) 0.A58, 3.6.0, Copyright IBM Corp 2000, 2010. All rights reserved. $ java -jar ~/jdt/ecj-3.6.jar -1.5 SomeClass.java ---------- 1. ERROR in SomeClass.java (at line 9) public class SomeClass extends Base implements EqualityComparable<String> { ^^^^^^^^^ Name clash: The method equalTo(T) of type EqualityComparable<T> has the same erasure as equalTo(Object) of type Base but does not override it ---------- 1 problem (1 error)
(In reply to comment #3) > Trying to verify this bug I can't find a version of ecj that actually > exhibits the bug. Could you please advise how I could reproduce the > bug to see what actually the fix fixed? I guess the only way to reproduce this is to test a version closer to the date of the comment (2010-08-10). Unfortunately I don't have version handy to test it myself. Otherwise, you can also test it black box manner.
Verified that - javac 1.6 exhibits this bug - non of the following versions of ecj has this bug: 3.6, 3.6.1, 3.6.2, 3.7Mx, 3.7.0 - Also 3.7 + the Java7 patch feature correctly reports the error, using "Eclipse Java Development Tools Patch for Java 7 Support (Beta) 1.0.0.v20110623-0900"