Re: [abc-users] Semantics of private member introduction

From: Eric Bodden <eric.bodden_at_mail.mcgill.ca>
Date: Wed, 19 Nov 2008 13:05:17 -0500

Ah, now I can confirm it. Compiling with...

java -cp abc-ja-complete.jar abc.main.Main -ext abc.ja Test.java

... indeed causes no errors. I guess somebody should look into this.

Eric

2008/11/19 Hossein Sadat-Mohtasham <sadat_at_cs.ualberta.ca>:
> Thanks Eric,
>>
>> Which abc version are you using? Are you using the JastAdd frontend by
>
> I'm using the abc-1.3.0 release with JastAdd front-end.
>
> --Hossein
>
>>
>> any chance?
>>
>> Eric
>>
>> 2008/11/18 Hossein Sadat-Mohtasham <sadat_at_cs.ualberta.ca>:
>>>
>>> Hi,
>>> I've had the impression that a private field introduction is only visible
>>> to
>>> the defining aspect and not the target class. That's what I get in
>>> AspectJ;
>>> however, I get no complaint when I access such a field from within a
>>> target
>>> when compiling using abc-1.3.0.
>>> Here is an example:
>>> /*
>>> *
>>> * 1) private y should not be visible in Test but it is.
>>> * 2) private x should not be visible in Aspect, but it is.
>>> *
>>> */
>>> public class Test {
>>>
>>> private int x = 0;
>>>
>>> public static void main(String[] args) {
>>> Test test = new Test();
>>> test.f();
>>> }
>>> public void g() {
>>> y = 2;
>>> }
>>> }
>>> aspect testaspect {
>>>
>>> private int Test.y = 0;
>>>
>>> public void Test.f() {
>>> x = 1;
>>> y = 1;
>>>
>>>
>>>
>>> g();
>>>
>>> }
>>> }
>>> I might be mistaken, so let me know if so. I was expecting to get 2
>>> compile
>>> errors: one for accessing x in testaspect and the second one for
>>> accessing y
>>> in Test. With abc I don't get neither.
>>> Thanks in advance for your thoughts.
>>> --Hossein
>>
>>
>>
>> --
>> Eric Bodden
>> Sable Research Group, McGill University, Montréal, Canada
>> Got an interesting job offer? http://www.bodden.de/hire-me/
>
>
>

-- 
Eric Bodden
Sable Research Group, McGill University, Montréal, Canada
Got an interesting job offer? http://www.bodden.de/hire-me/
Received on Wed Nov 19 2008 - 18:05:28 GMT

This archive was generated by hypermail 2.2.0 : Thu Nov 20 2008 - 01:40:17 GMT