Bug 225518 - [1.5][compiler] Incorrectly report ambiguity of static methods with generics
Summary: [1.5][compiler] Incorrectly report ambiguity of static methods with generics
Status: VERIFIED DUPLICATE of bug 268837
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.5 M7   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-03 06:15 EDT by Ildar Safarov CLA
Modified: 2009-04-28 09:21 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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)