Summary: | Referencing a static inner class (that extends Exception) in an interface from another class results in a compile time error | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Michael Bradburn <michaelpb78> |
Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
Status: | RESOLVED INVALID | QA Contact: | |
Severity: | blocker | ||
Priority: | P3 | CC: | kanishka_liyanage |
Version: | 3.0 | ||
Target Milestone: | 3.1 M3 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: |
Description
Michael Bradburn
2004-10-01 15:06:27 EDT
Aren't inner types supposed to be referenced using OuterClass.InnerClass (instead of OuterClass$InnerClass)? I don't understand how you can compile this code with javac. I tried version 1.3.1, 1.4.2_05 and 1.5.0 and all of them fail with: symbol : class I$MyException location: class p1.A perchance you meant 'I.MyException' protected void test() throws I$MyException { ^ 1 error or: p1/A.java:4: cannot resolve symbol symbol : class I$MyException location: class p1.A protected void test() throws I$MyException { ^ 1 error It doesn't compile. If you replace I$MyException with I.MyException, then it works fine on Eclipse and any javac version. I also tried jikes 1.21 and it fails. Close as INVALID. It does compile as outer$inner if you compile outside of eclipse (such as by invoking javac at a prompt). Just compile I first and then A without using an IDE. I guess this really isn't that important since the person who wrote this code did it in a non-standard way and I should just fix the code. It would be interesting to find out why it doesn't work in eclipse, though. Our compiler doesn't allow to use member types with binary names, as per spec. Looks like other compilers let it go thru. |