Bug 132926 - Compiler crashes processing annotations
Summary: Compiler crashes processing annotations
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 1.5.1   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-22 20:05 EST by Ramnivas Laddad CLA
Modified: 2006-04-04 14:01 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ramnivas Laddad CLA 2006-03-22 20:05:02 EST
Just upgraded to latest AJDT (Version: 1.3.1, Build id: 20060322082516
AspectJ version: 1.5.1.20060320075953)
and the compiler crashed while rebulding the project (which used to work fine 
using using the March 16th version). Retrying with 'clean' build produced the
same crash.

java.lang.NullPointerException
at org.aspectj.weaver.AnnotationX.ensureAtTargetInitialized(AnnotationX.java:158)
at org.aspectj.weaver.AnnotationX.specifiesTarget(AnnotationX.java:98)
at org.aspectj.weaver.bcel.BcelWeaver.verifyTargetIsOK(BcelWeaver.java:1450)
at org.aspectj.weaver.bcel.BcelWeaver.applyDeclareAtType(BcelWeaver.java:1417)
at org.aspectj.weaver.bcel.BcelWeaver.weaveParentTypeMungers(BcelWeaver.java:1366)
at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1223)
at org.aspectj.weaver.bcel.BcelWeaver.weaveParentsFor(BcelWeaver.java:1211)
at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1058)
at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave(AjCompilerAdapter.java:311)
at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCompiling(AjCompilerAdapter.java:183)
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:845)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:241)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:161)
at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:122)
at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)

NullPointerException thrown: null
Comment 1 Ramnivas Laddad CLA 2006-03-22 20:25:34 EST
I wonder if this is related to #128655. There is one major difference, though. #128655 crahsed only during incremental compilation, whereas this one crahses on full build.
Comment 2 Andrew Clement CLA 2006-03-23 03:55:32 EST
this is no doubt because of the ASM support I added recently which has only just made it into an AJDT build.  Can you try putting this in the 'non standard options' field for the offending project?

-Xset:activateLightweightDelegates=false

does it help it get past the NPE?
Comment 3 Andrew Clement CLA 2006-03-23 04:42:44 EST
after looking a little further at it - I'm even more convinced its the ASM code since now annotations can be of two types depending on whether we loaded an ASM delegate for a type or a BCEL delegate for a type.  I missed a path in the annotation processing code that should have done different things based on the kind of delegate loaded.
Comment 4 Ramnivas Laddad CLA 2006-03-23 12:18:17 EST
I just tried the suggested "-Xset:activateLightweightDelegates=false" option and could get a successful compilation.
Comment 5 Andrew Clement CLA 2006-03-24 03:44:15 EST
Excellent - the option is doing exactly what I wanted - it deactivates the loading of classes via the ASM bytecode toolkit which is the problem here. I'll fix the bug soon as I can, now that I've finished doing my 40,000 sessions at AOSD.
Comment 6 Andrew Clement CLA 2006-03-24 05:10:24 EST
fix for this checked into AJ now.
Comment 7 Andrew Clement CLA 2006-04-04 14:01:39 EDT
fix available now in 1.5.1 - will be in AJDT shortly.