Summary: | After throwing advice on ctors doesn't execute for inter-type decls | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Ron Bodkin <rbodkin+LISTS> |
Component: | Compiler | Assignee: | Jim Hugunin <jim-aj> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P2 | ||
Version: | 1.1.1 | ||
Target Milestone: | 1.2 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Ron Bodkin
2003-10-09 13:53:43 EDT
This is a subtle problem. The issue surrounds the treatment of field initialization with respect to the scope of execution and initialization join points. Field initialization within a class was considered part of the constructor execution join point with the change to 1.1 (see http://dev.eclipse.org/viewcvs/indextech. cgi/~checkout~/aspectj-home/doc/README-11.html#CONSTRUCTOR_EXECUTION_IS_BIGGER ) as there was no principled way in bytecode to detect otherwise. Field initialization outside of the class is not considered part of the constructor execution join point (the field belongs to the aspect), so it is correct that the advice does not run. Changing the advice to initialization rather than execution will cause it to execute in both cases. See the test case in tests/bugs/AfterThrowingCtor.java for an example that illustrates both of these cases. |