blob: 387b21d55103c1d05f40cecf5781f0e4b8688ec6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Interacting private ITDs
public class InteractingOldAndNew {
public static void main(String []argv) {
InteractingOldAndNew inst = new InteractingOldAndNew();
inst.setI1(12);
inst.setI2(65);
int value = inst.getI1();
if (value!=12) { throw new RuntimeException(Integer.toString(value)); }
value = inst.getI2();
if (value!=65) { throw new RuntimeException(Integer.toString(value)); }
}
}
aspect X {
private int InteractingOldAndNew.i;
public int InteractingOldAndNew.getI1() {
return i;
}
public void InteractingOldAndNew.setI1(int newvalue) {
i = newvalue;
}
}
aspect Y {
private int InteractingOldAndNew.i;
public int InteractingOldAndNew.getI2() {
return i;
}
public void InteractingOldAndNew.setI2(int newvalue) {
i = newvalue;
}
}
|