Bug 225518

Summary: [1.5][compiler] Incorrectly report ambiguity of static methods with generics
Product: [Eclipse Project] JDT Reporter: Ildar Safarov <ildar.safarov>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: jarthana, Olivier_Thomann, philippe_mulet, srikanth_sankaran, yozh
Version: 3.4   
Target Milestone: 3.5 M7   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ildar Safarov CLA 2008-04-03 06:15:44 EDT
Build ID: 3.4.0 I20080207-1530

Steps To Reproduce:
===
public class A {
    public static void hello() {}
}

public class B extends A {
    public static <T> void hello() {}
}

public class C {
    public static void main(String[] args) {
        B.hello(); // Eclipse reports ambiguty here
    }
}
===
this example is correct but Eclipse reports ambiguty for B.hello()

this error is reproduced only in 3.4 version, everything is fine in 3.3

More information:
Comment 1 Kent Johnson CLA 2008-04-03 10:25:02 EDT
This is the error I get from javac (both 1.5 & 1.6):

C.java:3: reference to hello is ambiguous, both method hello() in A and method
<T>hello() in B match
Comment 2 Ildar Safarov CLA 2008-04-04 07:16:28 EDT
(In reply to comment #1)
> This is the error I get from javac (both 1.5 & 1.6):
> 
> C.java:3: reference to hello is ambiguous, both method hello() in A and method
> <T>hello() in B match
> 

Sorry for confusing example. Just wanted to throw away all real project things. I really have described behaviour editing my code in Eclipse while 1.6 javac says everything is ok. I'll try to reproduce bug in another example soon.
Comment 3 Kent Johnson CLA 2009-03-18 11:19:03 EDT
Bug 268837 contains a reproduceable testcase

*** This bug has been marked as a duplicate of bug 268837 ***
Comment 4 Jay Arthanareeswaran CLA 2009-04-28 01:32:25 EDT
Verified for 3.5M7 using I20090426-2000 (Duplicate of 268837)