Community
Participate
Working Groups
Created attachment 281434 [details] Maven project to reproduce NPE After updating the PatternTesting project from AspectJ 1.8.x to 1.9.5 one module crashed during compilation with java.lang.NullPointerException at org.aspectj.weaver.ReferenceType.getWeaverState(ReferenceType.java:680) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:693) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:672) at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.createBinaryTypeFrom(AjLookupEnvironment.java:1453) at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:1046) Steps to reproduce the NPE: - extract attached ZIP file (with Maven project inside) - change to the extracted project (`cd aspectj-NPE`) - compile: `mvn clean compile` You'll find also an ajcore-file inside from the crash. It happens not only on Windows put also on MacOS
I am also experiencing this issue upgrading 1.8.4 to 1.9.5 (in order to resolve generic parameter compile issues). Also MacOS here; 1.9.4 does not produce the same problem.
Thanks so much for the testcase. The type for which we are having trouble (null delegate) is: patterntesting.concurrent.SynchronizedAspect$ajcMightHaveAspect This is one of the synthetic classes generated during matching. I think this is due to JDT updating much more frequently than it used to, to keep up with Java versions. They are changing many things that are hitting us (when we used to be on the same version for years at a time). In this case it looks like it is asking to resolve types earlier than it used to, for computing stack map frames in the bytecode.
Fixed for the problematic project here. I initialized the delegate for the synthetic type early enough to keep the process happy.