Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] field name conflict

My guess is that the aspect's field shadows the class' original field, in the same way that a local variable in a method can shadow a field. I'm just speculating, based on the observed behavior.
dean

On Feb 5, 2008, at 1:19 PM, Dehua Zhang wrote:


Hi Gijs,

In my sample code, the aspect is modified with "privileged", so private fields of classes is also visible to the aspect, considering this, do you think there is conflict?

--
Dehua Zhang
Sable Research Group, McGill University
Montréal, Québec, Canada
http://www.cs.mcgill.ca/~dzhang25





-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx on behalf of Gijs Peek
Sent: Mon 2/4/2008 14:16
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] field name conflict

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

This is intended behavior (i.e., no bug). The private inter-type field
is privately visible to the aspect, and as such does not conflict with
the private member in the class.

See
http://www.eclipse.org/aspectj/doc/released/progguide/semantics-declare.html#access-modifiers
for details.

cheers,
- Gijs Peek

Dehua Zhang wrote:
See the sample code below,

public class OneType {
   private String r;
}

privileged aspect A {
   private int OneType.r; //no error
}

Since aspect A is declared as privileged, so it should have access to
the private filed "String OneType.r", therefore, the ITD "int OneType.r"
is conflict with the "String OneType.r", I got no warning regarding this.

However, I got an error for the following code,
privileged aspect A {
   public int OneType.r; //[error] inter-type declaration from A
conflicts with existing member: java.lang.String onType.r
}


Is this an intended behavior or a bug? I tried both 1.5.4 and
DEVELOPMENT-20080125213731.

--
Dehua Zhang
Sable Research Group, McGill University
Montréal, Québec, Canada
http://www.cs.mcgill.ca/~dzhang25

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBR6dknbb66fbjXztVAQLScw/+L50TTmsxoUIHcs1/SGm5HEMD9tWVQpbb
W0hrgMzev6l+dJnd2v/a3JzE0KD8PUUtbPOXE85n3qW6kX5nTlVMd9rPRWJCBBjK
RlLcNF3PWgE/CBFNsE9n41UcHtgtFjE7FnWApPJeuMgyjDVkGUY+Ttttnt3O7gTJ
1hmd3lyUjaaCR5HuveDvJIEQhxoL8dRt42HLQt9PyflV0zUwDk91VvC9HakLgv1C
IzMN1Q/DLqVVhFNvzRjrPRRQdAMteMf+6yS2JA3GU5Lu4ijBUHlu8ljufLkzOHHK
JIdzw/lgdzcfKVtd0S23glQOB42LDD7wRtBZzoSFxB6oxV77M+YGWOwPJQKiKmHu
oefPrBn7CJbIRFTZcZ6hgXi7dsACpTtHgLGHgr7xAOWO0rKYrCtAdhXNutn0vQiF
2n9ks9/hk62YGhOzxLrcweJUgTh+5TLxKUoe+Hg5kjkGAoxuPsMNXmOgQgSI4O6+
cDkrKSS4FH0+RBnFmD6ElaRqT/UaaKGZAE6YZcDx1Z2lsFgFrVAuR4jX2JtlKtYa
Pv4oMEhyiZQTer0WG08JeRBF6hziO3qB7hPkrQYqLmq5iBPeosWb/bhNSvYrye2p
jBjxx5Xmvu3U+gMAs2qBSkVSK/YoRVT3WYkWyk9eXhuzj9LNTzyzqJOw8Y5rOPg8
y1hqeAL2T8c=
=w2QV
-----END PGP SIGNATURE-----


_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Dean Wampler, Ph.D.
dean at objectmentor.com
See also:
http://aquarium.rubyforge.org     AOP for Ruby
http://www.contract4j.org         Design by Contract for Java5




Back to the top