Community
Participate
Working Groups
From the mailing list (stephane.chomat@imag.fr): Hi I have a null pointeur exception at org.aspectj.weaver.ReferenceType.makeDeclaredSignature. The referenceType has no genericType and no typeParameters. I attached a eclipse project eclipses which shows the problem with apectj. The problem comes that there is a generic interface and a non generic interface. This sample pattern is : interface I { } interface IE1<T> { } interface IE2 { } aspect A1 { declare parents : I implements IE1<String>; } aspect A2 { declare parents : I implements IE2; } A first solution is to add a test to the beginning of method getSignatureForAttribute before the call of makeDeclaredSignature. public String getSignatureForAttribute() { if (genericType == null || typeParameters == null) return this.getSignature(); return makeDeclaredSignature(genericType,typeParameters); } I think it resolve my problem. Thanks.
test and fixes checked in - waiting on build before closing. Test also verifies signature is "Ljava/lang/Object;LIE2;LIE1<Ljava/lang/String;>;"
I think I have encountered the same issue around using Declare Parent (I posted a bunch of messages to the user list). I encountered this problem with a 1.3.0 build of AJDT, but I had a new error dialog after updating to: Version: 1.3.0 Build id: 20050928171145 AspectJ version: 1.5.0.200509270946 Using: Eclipse 3.1 Java 5 (Jrockit for running eclipse - project JDK sun Java 5) Under Linux (Suse 9) Here are the details of my null pointer exception: java.lang.NullPointerException at org.aspectj.weaver.ReferenceType.makeDeclaredSignature(ReferenceType.java:553) at org.aspectj.weaver.ReferenceType.getSignatureForAttribute(ReferenceType.java:99) at org.aspectj.weaver.bcel.LazyClassGen.fixupGenericSignatureAttribute(LazyClassGen.java:547) at org.aspectj.weaver.bcel.LazyClassGen.writeBack(LazyClassGen.java:478) at org.aspectj.weaver.bcel.LazyClassGen.getJavaClass(LazyClassGen.java:600) at org.aspectj.weaver.bcel.BcelWeaver.getClassFilesFor(BcelWeaver.java:1222) at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1195) at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1030) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(AjCompilerAdapter.java:299) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCompiling(AjCompilerAdapter.java:178) at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$2$f9cc9ca0(CompilerAdapter.aj:70) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:367) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:760) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:225) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:151) at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:120) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) NullPointerException thrown: null (In reply to comment #1) > test and fixes checked in - waiting on build before closing. > Test also verifies signature is "Ljava/lang/Object;LIE2;LIE1<Ljava/lang/String;>;"
fix available in latest AJ dev build - will be in AJDT soon (monday?)