Community
Participate
Working Groups
Created attachment 172090 [details] AspectJ compile log Using the Maven plugin to compile aspects into my code I get the following exception: … ---- Exception Information --- java.lang.NullPointerException at org.aspectj.weaver.bcel.BcelObjectType.ensureGenericSignatureUnpacked(BcelObjectType.java:823) at org.aspectj.weaver.bcel.BcelObjectType.getSuperclass(BcelObjectType.java:228) at org.aspectj.weaver.ReferenceType.getSuperclass(ReferenceType.java:905) at org.aspectj.weaver.bcel.AtAjAttributes.handleAspectAnnotation(AtAjAttributes.java:490) at org.aspectj.weaver.bcel.AtAjAttributes.readAj5ClassAttributes(AtAjAttributes.java:234) … I have attached the complete log as attachment.
Is there any way you could share with me the project that causes this? I'm nervous about just putting in a guard for the NPE and would rather understand what is leading to the failure. It appears a raw/parameterized type has forgotten its generic type somehow.
Created attachment 172413 [details] Project causing the issue It's perfectly possible that I am messing things up here :). But even in this case I think a more expressive exception would be useful. Attached the project. Running mvn clean test-compile should produce the error log files.
thanks for the project. The NPE is occurring (I assert) because the generic type is being used before it has been set. A particular path is being taken into the generic signature unpacker and it is too early to assume the generic type has been set. If we guard on null, it looks like the caller will subsequently set the generic type correctly, so that is what I'll do.
After building an AspectJ with the proposed change in, I see that the NPE was hiding a real error in the project: [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Compiler errors : error at <Unknown>::0 The generic aspect 'org.synyx.hades.domain.auditing.AuditingAdvice' must be declared abstract I'll publish this build today as AspectJ 1.6.9.RC2