JDK-6249791 : Method lookup error message could be more userfriendly
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2005-04-03
  • Updated: 2010-04-02
  • Resolved: 2009-03-13
Related Reports
Relates :  
Description
Please see the following code:

public class Test9{
    public<T> T myMethod(Object st){
        
    }
    public static void main(String... arg){
        Test9 test = new Test9();
        test.myMethod();
    }
}
Output of the code when compiled:
bash-2.05b$ $b/javac Test9.java
Test9.java:26: <T>myMethod(java.lang.Object) in Test9 cannot be applied to ()
        test.myMethod();
            ^
1 error

Better wording of exception message will be more user friendly.
###@###.### 2005-04-03 12:23:55 GMT

Comments
EVALUATION This has been fixed by the recent diagnostic work done for 7 (see 6717241) Now the diagnostic is: TestX.java:7: method myMethod in class Test9 cannot be applied to given types test.myMethod(); ^ required: java.lang.Object found: no arguments 1 error
13-03-2009