Community
Participate
Working Groups
Name is poor, needs work. The intention would be that for static join points there is a shared aspect instance whilst for non-static join points there is an aspect instance per object instance. This is another spin off from bug 89009. This needs some use cases before serious thought is put into the design. Some proposed code generation approaches are shown in 89009 (comment 22). The shared instance per static parts is possibly already workable through something like this: aspect Foo pertypewithin(*) { int[] counter = new int[1000]; before(): execution(* *(..)) && !this(Object) { // Access the counter per joinpoint shadow in advised types int i = counter[thisJoinPointStaticPart.getId()]; } } The instance per non-static part is possibly already workable through something like this: aspect Foo perthis(!within(Foo)) { int[] counter = new int[1000]; before(): execution(* *(..)) { // access the unique counter for this aspect instance and this joinpoint // - a different 'this' will mean a different aspect instance // - a different joinpoint will mean a different id int i = counter[thisJoinPoint.getId()]; } }