Community
Participate
Working Groups
/* initialisers of intertype fields should match field set pointcuts. In the example below, the output should be set field set(int C.n) set field set(int C.m) get field get(int C.n) set field set(int C.n) but the first field set (of C.n) is not picked up. */ aspect Aspect { private int C.n = 13; before() : get(* C.*) { System.out.println("get field "+thisJoinPointStaticPart); } before() : set(* C.*) { System.out.println("set field "+thisJoinPointStaticPart); } public void C.foo() { n++; } } class C { int m = 20; } public class ITFieldsAdvice { public static void main(String[] args) { C c = new C(); c.foo(); } }
marked as target 1.2.1
Fix checked in, waiting for build. Some AspectJ facts. - When the ITD is a private ITD, the field generated has a 'special' "ajc$XXX" name. - *No* ajc$XXX field references are considered join points. - Join points for references to these fields are surfaced as follows. Each field has a set and a get dispatcher method generated. These methods are tagged with the 'effective signature' attribute of a FIELD_GET or FIELD_SET shadow. This means when a call to the dispatcher method is found in the code, it is matched upon as if it was a field get or set join point. - When ITD field initializers are generated, they normally directly set the named field. Field initializer methods are *not* tagged with the effective signature attribute. The fix is to change the body of the generated field initializer so that it delegates to the field set dispatcher method - the call to this method will ensure the right field set join point surfaces for the match.
Fix available now: BUILD COMPLETE - build.337 Date of build: 08/11/2004 17:19:19 Time to build: 91 minutes 45 seconds Last changed: 08/11/2004 14:18:49 Latest good AspectJ jar available at: download.eclipse.org/technology/ajdt/dev/aspectj-DEVELOPMENT.jar
Fix released as part of AspectJ 1.2.1