Bug 93492 - RFE: Using "this" designator as Dummy Variable
Summary: RFE: Using "this" designator as Dummy Variable
Status: REOPENED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-03 05:01 EDT by Rodrigo Gonçalves CLA
Modified: 2009-08-30 02:49 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Gonçalves CLA 2005-05-03 05:01:45 EDT
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
Comment 1 Adrian Colyer CLA 2005-08-26 11:25:14 EDT
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.
Comment 2 Eclipse Webmaster CLA 2009-08-30 02:49:42 EDT
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.