Community
Participate
Working Groups
The JDT gives a bogus build error if you have a parameterized class, which contains an abstract inner class and a method that takes an object of that type as a parameter; and a subclass creates an instance of that inner class and calls the method on the base class. It says that the inner class instance of not appropriate for the parameters of the method. The same code compiles without a problem using Sun's javac. It also built on eclipse 3.1m6, but is failing on 3.1RC1. Here is a simple rero case - the second class, Bar, does not compile in the JDT: public class Foo<T> { protected abstract class InnerFoo { protected abstract void doSomething(); } protected void run( InnerFoo innerFoo ) { innerFoo.doSomething(); } } public class Bar extends Foo<Integer> { public void go() { InnerFoo inner = new InnerFoo() { protected void doSomething() { System.out.println( "hello" ); } }; run( inner ); } } The error is on the call to run(): The method run(Foo.InnerFoo) in the type Foo<Integer> is not applicable for the arguments (Foo<Integer>.InnerFoo)
Could not reproduce in latest.
Got fixed along with other changes. Added GenericTypeTest#test721.