Summary: | [ataspectj][matching] NPE weaving complex pointcuts with if() | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | comron sattari <comron.sattari> | ||||
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | aclement, artymt, comron.sattari | ||||
Version: | DEVELOPMENT | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
comron sattari
2006-06-02 01:01:42 EDT
Sorry for the poor formatting. testcase added (commented out in Ajc152Tests) - does this all work fine with code style rather than annotation style? I have not tried code style. I can test it out, but don't have the time to do so right now. It still fails at 160 too. To avoid the NPE I tweaked the Pointcut Rewriter - this was not correctly ensuring the ConcreteCflowPointcut was occurring before the If pointcut when final concretization was occurring - this left an element of the exposed state at the joinpoint null and so the NPE. Switching them around causes the Cflow pointcut to correctly insert its entry - but then we fail later because we can't convert from a Map to an int. Here is the simplified code that fails in the same way: @Pointcut("call(* someMethod(..)) && args(arg1) && if()") public static boolean someMethod2if(int arg1) { return true; } @Pointcut("cflow(execution(* doProcess(..) ) && args(*, args)) && this(SomeClass+) ") public void inSomeClass2(Map args) {} @After( "inSomeClass2(args) && someMethod2if(arg1) ") public void deleteManagerInSomeClass2(Map args,int arg1) { } This reason we try is that someMethod2If() takes an int (and is at index 0) - whilst at the shadow the parameters are (map,int). In code style we do the right thing, but for some reason in Annotation Style we ignore the useful information we have collected that maps required method parameters to exposed state. Changing it to use this information causes this test to pass but some others to fail in the suite. Created attachment 93036 [details]
Beginnings of a fix
Beginnings of a fix for this. It fixes this failing case but another couple of the tests in the suite fail, needs more thought before being complete.
unsetting the target field which is currently set for something already released |