Bug 98504

Summary: [1.5][compiler] Compiler difference between javac and jdt?
Product: [Eclipse Project] JDT Reporter: Andrew Clement <aclement>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mlists
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Andrew Clement CLA 2005-06-06 09:51:39 EDT
We have had a bug raised against AspectJ (bug 95992) but it turns out to be a
difference between the JDT compiler and SUNs javac.  Here is the program:

interface Base<T> {
    static interface Inner {
    }
}
class Test<T extends Test.InnerTest> implements Base<T> {
    static class InnerTest implements Inner {
    }
}

Compiling with 3.1m7 or 3.1rc1 compilers results in:

Test.java:14 [error] Inner cannot be resolved to a type
static class InnerTest implements Inner {

Sun's javac compiles it without any error.
The error can be avoided by simply writing "Base.Inner" instead of just "Inner".
Also, it compiles fine if the constraint "extends Test.InnerTest" is left away.
Comment 1 Philipe Mulet CLA 2005-06-06 12:39:00 EDT
Reproduced in latest
Comment 2 Philipe Mulet CLA 2005-06-06 15:45:41 EDT
+1 for RC2
Comment 3 Kent Johnson CLA 2005-06-08 14:38:25 EDT
Added to GenericType test050
Comment 4 Olivier Thomann CLA 2005-06-09 09:38:40 EDT
Verified with N20050609-0010 + JDT/Core HEAD
Comment 5 Maxime Daniel CLA 2005-06-10 10:12:30 EDT
Verified for 3.1 RC2 using build I20050610-0010
Comment 6 Frederic Fusier CLA 2005-06-10 10:28:00 EDT
close