Bug 94747 - [1.5][compiler] Error message is not optimal
Summary: [1.5][compiler] Error message is not optimal
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-11 11:21 EDT by Olivier Thomann CLA
Modified: 2005-05-12 13:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Thomann CLA 2005-05-11 11:21:41 EDT
Related to bug 84551, the reported error message is misleading.

Test case:
class Outer {
   class Inner { }
   
   static void test(Inner i) { }
}
 
compile sans problème, mais:
class Outer<T> {
   class Inner { }
   
   static void test(Inner i) { }
}

We now report:
Cannot make a static reference to the type parameter Inner

This is not clear what the problem is.

javac reports:
Outer.java:4: non-static class Outer.Inner cannot be referenced from a static
context
        static void test(Inner i) { }
                         ^
1 error

Not sure if this is much better.
Comment 1 Philipe Mulet CLA 2005-05-11 18:24:24 EDT
Tweaked error message to read:
Cannot make a static reference to the non-static type Inner

Corrected testcases.
Comment 2 Philipe Mulet CLA 2005-05-11 18:24:43 EDT
fixed
Comment 3 Olivier Thomann CLA 2005-05-12 13:04:24 EDT
Verified in I20050510-0010 + JDT/Core 556.