Summary: | null value for thisJoinPointStaticPart | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Ron Bodkin <rbodkin+LISTS> | ||||
Component: | Compiler | Assignee: | Adrian Colyer <adrian.colyer> | ||||
Status: | RESOLVED INVALID | QA Contact: | |||||
Severity: | critical | ||||||
Priority: | P2 | ||||||
Version: | DEVELOPMENT | ||||||
Target Milestone: | 1.5.0RC1 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Ron Bodkin
2005-10-21 12:11:27 EDT
I am also seeing this stack trace when incrementally compiling in AJDT. I would guess that it's caused by the same bug. java.lang.NullPointerException at org.aspectj.weaver.patterns.IfPointcut.equals(IfPointcut.java:127) at org.aspectj.weaver.patterns.PointcutEvaluationExpenseComparator.compare (PointcutEvaluationExpenseComparator.java:65) at java.util.TreeMap.compare(TreeMap.java:1093) at java.util.TreeMap.put(TreeMap.java:465) at java.util.TreeSet.add(TreeSet.java:210) at org.aspectj.weaver.patterns.PointcutRewriter.collectAndNodes (PointcutRewriter.java:239) at org.aspectj.weaver.patterns.PointcutRewriter.collectAndNodes (PointcutRewriter.java:232) at org.aspectj.weaver.patterns.PointcutRewriter.simplifyAnd (PointcutRewriter.java:190) at org.aspectj.weaver.patterns.PointcutRewriter.simplifyAnds (PointcutRewriter.java:182) at org.aspectj.weaver.patterns.PointcutRewriter.rewrite (PointcutRewriter.java:35) at org.aspectj.weaver.bcel.BcelWeaver.rewritePointcuts(BcelWeaver.java:480) at org.aspectj.weaver.bcel.BcelWeaver.prepareForWeave(BcelWeaver.java:437) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.weave (AjCompilerAdapter.java:283) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterCompiling (AjCompilerAdapter.java:178) at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspect j_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:759) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild (AjBuildManager.java:249) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild (AjBuildManager.java:158) at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:117) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run (AspectJBuildManager.java:191) NullPointerException thrown: null From further investigation, I think the second stack trace is unrelated. I was seeing this bug in a recent dev build on pointcuts like this protected pointcut isMonitorEnabled() : if(aspectOf().isEnabled()); I uncommented them all out (to be within(*)) and it worked. I then restored them and things now seem to be working?! So the stack trace from the second comment in this bug is fixed, although I don't think the first bug is fixed (I am hitting yet another bug that is preventing me from testing to see if the first part has been fixed yet but presumably not). I'm about to check in a fix for the stack trace in comment #1. This could possibly affect the other problem ... but I'm not all that confident. I've no idea whats happening in comment #2. fix checked in for stack trace in comment #1. fix available for problem reported in comment #1 - does it make any difference for your other scenarios ron or do you need for an AJDT before you can check? I've added a compile-and-run test for bugs150/Pr113368.aj in the tests module. This replicates the failing glassbox inspector logic and is passing for me. Are you still seeing the original problem Ron? It's hard to tell from the comments whether everything reported in this bug is now fixed or not... The original bug is still failing... it took some work to narrow it down, but here's a patch to the test case that fails for me with the same error inside the test harness.... Created attachment 30360 [details]
patch to test case that reproduces the problem
Great - thanks Ron. I can reproduce the failure now with your patch to the test case. Now all I have to do is figure out why.......... OK, the test case fails, but not in the way that you originally reported, and in a way that is "correct". This test fails for me with an org.aspectj.lang.NoAspectBoundException: ManagedSubBean as the root cause of the ExceptionInInitializer. This is the expected behaviour as seen by following the chain of reasoning: The execution of hook() causes ManagedSubBean.aspectOf to be called. This causes the staticinitialization of ManagedBean Which causes the execution of the AutoStart advice Which calls ManagedSubBean.aspectOf() ..... .... which fails (correctly) with a NoAspectBoundException because there is no aspect bound until the staticinitializers and constructors have run. If I remove any of the components of the test to try and get around this, it passes again.... Are you seeing NoAspectBound with this test case? Or do you get the NPE?? I didn't see the chained exception from the test output so I assumed it was the same NPE error I was seeing. However, the original code that does generate the NPE is failing in the same way: it is trying to access the thisJoinPointStaticPart field before staticinitialization is completed. So this bug is invalid. |