diff options
author | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2002-12-16 18:51:06 +0000 |
commit | 144143c2970a1e874d74cdbd0f8c622d4282a3c3 (patch) | |
tree | b12383d3d9e76c7e1f25f7fbec83051ef17f81fb /tests/new/SuperInIntroductionCE.java | |
parent | fafae443719b26159ab2d7dac1c9b46b5e00b671 (diff) | |
download | aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.tar.gz aspectj-144143c2970a1e874d74cdbd0f8c622d4282a3c3.zip |
initial version
Diffstat (limited to 'tests/new/SuperInIntroductionCE.java')
-rw-r--r-- | tests/new/SuperInIntroductionCE.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/new/SuperInIntroductionCE.java b/tests/new/SuperInIntroductionCE.java new file mode 100644 index 000000000..fb8784156 --- /dev/null +++ b/tests/new/SuperInIntroductionCE.java @@ -0,0 +1,32 @@ + +import org.aspectj.testing.Tester; + +public class SuperInIntroductionCE { + public static void main (String[] args) { + int result = new Sub().getInt(); + Tester.check(2==result, "new Sub().getInt() !2==" + result); + } +} + +class Super { + private int privateInt = 1; + private int privateIntMethod() { return privateInt; } + int defaultedInt = 1; + int defaultIntMethod() { return privateInt; } +} + +class Sub extends Super { } + +class ObjectSub { } + +aspect A { + /** @testcase accessing private and default method and field of class within code the compiler controls */ + public int Sub.getInt() { + int result = super.privateInt; // CE 25 expected here + result += super.privateIntMethod(); // CE 26 expected here + // todo: move A and Super to separate packages + //result += defaultInt; // CE expected here + //result += defaultIntMethod(); // CE expected here + return result; + } +} |