Project: AspectJ
Bug 100227 [generics][itds] inner class with generic enclosing class
Reported: 2005-06-15 12:24:09 | Status: resolved fixed

ajc crashes with a NullPointerException when an intertype declaration tries to modify an inner class, if the enclosing (outer) class is generic: class Outer { class Inner {} } class Generic_Outer<T> { class Inner {} } aspect Injector { int Outer.outer; // works int Outer.Inner.inner; // works int Generic_Outer.outer; // works int Generic_Outer.Inner.inner; // crashes } /home/user/sgelin3/dev/java/ajc/new_bug/Bug.java [error] Internal compiler error java.lang.NullPointerException at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.fromBinding(EclipseFactory.java:202) at org.aspectj.ajdt.internal.compiler.ast.InterTypeFieldDeclaration.build(InterTypeFieldDeclaration.java:173) at org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration.buildInterTypeAndPerClause(AspectDeclaration.java:1020) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.buildInterTypeAndPerClause(AjLookupEnvironment.java:306) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.completeTypeBindings(AjLookupEnvironment.java:122) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:302) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:316) ...

Files changed in fix:
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java weaver/src/org/aspectj/weaver/TypeX.java