Community
Participate
Working Groups
Hello, After a small discussion with Wes Isberg and Eric Bodden about dummy variables, I learned that Wes’s proposal on the use of “this” designator in type patterns had not been yet submitted as a Request For Enhancement (RFE). I think the afforementioned use of the “this” designator would bring advantages and open new possibilites for AspectJ. By using “this” on type patterns we could refer to the implicit instance and have pointcuts that capture join points solely on the implicit instance. This might cover some of the possible uses of an extension of the pointcut specification syntax to include the specification of dummy variables. Here’s a little example: import static java.lang.System.out; public class Test { private int i = 0; public void f() { this.i = 1; /* or this.i = 1; */ } public static void main(String[] args) { Test t = new Test(); t.f(); t.i = 2; } static private aspect CaptureThis { before() : set(* this.*) { out.println("Found this.set!"); } before() : set(* *.*) { out.println("Found set!"); } } } Regards, Rodrigo Gonçalves
We're not going to get to this in AJ 1.5.0. Marking as "LATER" for consideration in 1.5.1 and future release planning.
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.