Community
Participate
Working Groups
The following program causes an NPE: interface I { interface J< T > { T getT(); } } public aspect InnerGenericInterface { public T I.J< T >.intro() { return null; } } The following very similar program compiles and works fine: interface J< T > { T getT(); } public aspect InnerGenericInterface { public T J< T >.intro() { return null; } } Here's the exception trace: java.lang.NullPointerException at org.aspectj.ajdt.internal.core.builder.AsmElementFormatter.genLabelAndKind(AsmElementFormatter.java:162) at org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder.visit(AsmHierarchyBuilder.java:392) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:185) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.ja ... on$1.run(GlobalBuildAction.java:183) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58) Compile error: NullPointerException thrown: null
removing some noise from test program: // fails interface I { interface J< T > {} } public aspect InnerGenericInterface { public void I.J< T >.intro() {} } // succeeds interface J< T > {} public aspect InnerGenericInterface { public void J< T >.intro() {} }
ok - i've committed fixes for this. If you go further with ITDs on generic types, we still break, but I think that may need some parsing rule changes. For example: interface I1<A> { interface I2<B> {} } aspect X { public void I1<X>.I2<Y>.foo(X x,Y y) {} } could be possible but doesn't compile at the moment: ajc -1.5 Cool.java Cool.java:8 [error] Syntax error on token(s), misplaced construct(s) public void I1<X>.I2<Y>.foo(X x,Y y) {} ^^^ 1 error
bug 208991 raised to cover the double type parameterization case, closing this issue as fixed in 1.5.4