Bug 98504 - [1.5][compiler] Compiler difference between javac and jdt?
Summary: [1.5][compiler] Compiler difference between javac and jdt?
Status: CLOSED 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 RC2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-06 09:50 EDT by Andrew Clement CLA
Modified: 2005-06-10 10:28 EDT (History)
1 user (show)

See Also:


Attachments

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