Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-dev] Still the dummy variables...

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, Redrigo. This is expected behaviour.

set(...) takes a Field signature. Field are declared on types not on
Objects. Thus "this.<whatever>" is not a valid signature since "this"
is not a valid type. Thus not also is it correct to throw a at least
warning, it is also a reasonable warning IMHO.

Eric

- --
Eric Bodden
Chair I2 for Programming Languages and Program Analysis
RWTH Aachen University



________________________________

From: aspectj-dev-bounces@xxxxxxxxxxx
[mailto:aspectj-dev-bounces@xxxxxxxxxxx] On Behalf Of Rodrigo
Gonçalves
Sent: Montag, 28. März 2005 21:33
To: aspectj-dev@xxxxxxxxxxx
Subject: [aspectj-dev] Still the dummy variables...



Greetings,



A couple of days a go I posted a message asking if the introduction
of dummy variables on AJDT was ever considered.



Mr. Wes Isberg kindly answered the message mentioning that currently
it was not on the plans. He also kindly proposed a small idiom, using
JAVA this keyword, to achieve the same sort of goals.



I tried to use it but I found Xlint complaining about it. Below I
present a little code snippet that serves the purpose of recreate the
Xlint warning I got.





File: Test.java



public class Test {



    private int i = 0;



    public void f(){



        this.i = 1;



    }



    public static void main(String[] args) {



        Test t = new Test();



        t.f();



    }



File: CaptureThis.aj



import static java.lang.System.out;



public aspect CaptureThis {



        before() : set(* this.*) {



            out.println("Found this.set!");



        }



        before() : set(* *.*) {



            out.println("Found set!");



        }



    }



}





If you care to compile this in AJDT youll get the following output:



Found set!

Found set!



Correspondig to the second pointcut. Thus, the first one is ignored.
Also, on the Problems window you should get:



no match for this type name: this [Xlint:invalidAbsoluteTypeName]




Im using the latest Eclipse and AJDT builds.



Anyone can help me with this, please?



Kind regards,



Rodrigo Gongalves





________________________________

Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
<http://us.rd.yahoo.com/evt=31637/*http://smallbusiness.yahoo.com/reso
urces/>

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQkjvOswiFCm7RlWCEQKwuwCfYyexhJwm8jNfIEHVafB37m7n01kAoI7H
CGmXbaZhyVJPZCS+Lu6oPMIq
=kq8+
-----END PGP SIGNATURE-----





Back to the top