Community
Participate
Working Groups
The following code compiles alright with eclipse while JDK 7b138 rejects it with: X.java:7: error: methods f(T) from B<String> and f(String) from A<String> are in herited with the same signature public class X extends B<String> { ^ where T is a type-variable: T extends Object declared in class B 1 error // ------------------------ class A<T> { void f(String s) {} } class B<T> extends A<T> { void f(T t) {} } public class X extends B<String> { }
I'll follow up.
Compare eclipse behavior on: class X<T> { public void m(Number num) {} public void m(T t) {} } class Y extends X<Number> {}
Created attachment 195944 [details] Patch under consideration This patch fixes the problem for all compliance levels, though the plan is to release it only in BETA_JAVA7 branch. So a user will see this fix only when a Java 7 compliant release is made from eclipse.
All tests pass. Released in BETA_JAVA7 branch. Satyam, please review, TIA.
The patch looks good to me from a functionality point. However, now there is lot of redundant code out there. The outer for loop is executed only once, there is no need of the skip array and probably the duplicate array is also not necessary.
(In reply to comment #5) > The patch looks good to me from a functionality point. However, now there is > lot of redundant code out there. The outer for loop is executed only once, > there is no need of the skip array and probably the duplicate array is also not > necessary. I agree the fix has rendered a lot of the old code redundant - this slipped my attention. I suggest we will consider this issue closed as is and I'll clean this up when I fix bug 334313 (which is in the same area) in the next week or two -- Thanks.
(In reply to comment #6) > I agree the fix has rendered a lot of the old code redundant - this slipped > my attention. I suggest we will consider this issue closed as is and I'll > clean this up when I fix bug 334313 (which is in the same area) in the next > week or two -- Thanks. Sure, That's fine.
Verified using Eclipse Java 7 Support(Beta) feature patch v20110623-0900.