Community
Participate
Working Groups
ajc reports an error when compiling the following code: interface Base<T> { static interface Inner { } } class Test<T extends Test.InnerTest> implements Base<T> { static class InnerTest implements Inner { } } $ ajc -1.5 Test.java 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.
this program also fails in the regular Eclipse JDT compiler (3.1m7)
This program also fails to compile using the Java compiler in Eclipse 3.1 RC1. (same error)
Eclipse + JDT 3.1.0 (final) does compile it.
Another example of a similar bug, which causes error while trying to resolve classes: public interface ExampleInterface<T> { } public class ExampleClass { private static class MyClass implements ExampleInterface<String> { } } But if the inner class is defined without the generic, everything works: public class ExampleClass { private static class MyClass implements ExampleInterface { } }
This program: public interface ExampleInterface<T> { } public class ExampleClass { private static class MyClass implements ExampleInterface<String> { } } works with the latest dev build of the compiler (20050824100440), however the first program mentioned in this bug seems to have changed from failing because of JDT to failing because of AJ. Compiling it now gives: [error] can't find type Test$InnerTest
This bug had the same root cause as bug 108454, and is now fixed in tree. The most recent published build on the AspectJ downloads page contains the fix.