diff options
author | aclement <aclement> | 2009-10-31 19:20:20 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-10-31 19:20:20 +0000 |
commit | 061bb553ba7dd56ac37332ac5ef4487ea9f0bd3d (patch) | |
tree | 6bc10454a44fb9cbc27fd196f30ccc33e148e885 /tests/multiIncremental/oml | |
parent | 300f1c726b9ca1dcb999b4a67c31eb5a87f928d2 (diff) | |
download | aspectj-061bb553ba7dd56ac37332ac5ef4487ea9f0bd3d.tar.gz aspectj-061bb553ba7dd56ac37332ac5ef4487ea9f0bd3d.zip |
hierarchy walking testdata
Diffstat (limited to 'tests/multiIncremental/oml')
-rw-r--r-- | tests/multiIncremental/oml/base/src/A.java | 8 | ||||
-rw-r--r-- | tests/multiIncremental/oml/base/src/B.java | 8 | ||||
-rw-r--r-- | tests/multiIncremental/oml/base/src/B2.java | 7 | ||||
-rw-r--r-- | tests/multiIncremental/oml/base/src/C.java | 10 | ||||
-rw-r--r-- | tests/multiIncremental/oml/base/src/CC.java | 16 | ||||
-rw-r--r-- | tests/multiIncremental/oml/base/src/CCC.java | 15 | ||||
-rw-r--r-- | tests/multiIncremental/oml/base/src/DeclareWarningAndInterfaceMethodCW.java | 58 |
7 files changed, 122 insertions, 0 deletions
diff --git a/tests/multiIncremental/oml/base/src/A.java b/tests/multiIncremental/oml/base/src/A.java new file mode 100644 index 000000000..cccb8301c --- /dev/null +++ b/tests/multiIncremental/oml/base/src/A.java @@ -0,0 +1,8 @@ +package com.foo; + +public class A { + public void one() {} + public int two() {return 0;} + public void three(String s) {} +} + diff --git a/tests/multiIncremental/oml/base/src/B.java b/tests/multiIncremental/oml/base/src/B.java new file mode 100644 index 000000000..1f00eadaf --- /dev/null +++ b/tests/multiIncremental/oml/base/src/B.java @@ -0,0 +1,8 @@ +package com.foo; + +public class B extends B2 { + public void one() {} + public int two() {return 0;} + public void three(String s) {} +} + diff --git a/tests/multiIncremental/oml/base/src/B2.java b/tests/multiIncremental/oml/base/src/B2.java new file mode 100644 index 000000000..6d8187f1c --- /dev/null +++ b/tests/multiIncremental/oml/base/src/B2.java @@ -0,0 +1,7 @@ +package com.foo; + +public class B2 { + public void b2one() {} + public int b2two() {return 0;} +} + diff --git a/tests/multiIncremental/oml/base/src/C.java b/tests/multiIncremental/oml/base/src/C.java new file mode 100644 index 000000000..353e61465 --- /dev/null +++ b/tests/multiIncremental/oml/base/src/C.java @@ -0,0 +1,10 @@ +package com.foo; + +class C implements C2 { + public void one() {} + public void C2one() {} +} + +interface C2 { + public void C2one(); +} diff --git a/tests/multiIncremental/oml/base/src/CC.java b/tests/multiIncremental/oml/base/src/CC.java new file mode 100644 index 000000000..1f9657818 --- /dev/null +++ b/tests/multiIncremental/oml/base/src/CC.java @@ -0,0 +1,16 @@ +package com.foo; + +class CC extends CC2 { + public void CCone() {} + public void CC3two() {} +} + +abstract class CC2 implements CC3 { + public void CC2one() {} + public void CC3one() {} +} + +interface CC3 { + public void CC3one(); + public void CC3two(); +} diff --git a/tests/multiIncremental/oml/base/src/CCC.java b/tests/multiIncremental/oml/base/src/CCC.java new file mode 100644 index 000000000..10f3849a7 --- /dev/null +++ b/tests/multiIncremental/oml/base/src/CCC.java @@ -0,0 +1,15 @@ +package com.foo; + +class CCC implements CCC2 { + public void CCCone() {} + public void CCC2one() {} + public void CCC3one() {} +} + +interface CCC2 extends CCC3 { + public void CCC2one(); +} + +interface CCC3 { + public void CCC3one(); +} diff --git a/tests/multiIncremental/oml/base/src/DeclareWarningAndInterfaceMethodCW.java b/tests/multiIncremental/oml/base/src/DeclareWarningAndInterfaceMethodCW.java new file mode 100644 index 000000000..1fa07fd3f --- /dev/null +++ b/tests/multiIncremental/oml/base/src/DeclareWarningAndInterfaceMethodCW.java @@ -0,0 +1,58 @@ + +/* + * ajc fails to detect call join points using the + * declaring interface as the type when the method + * was declared in the aspect. + */ + +public class DeclareWarningAndInterfaceMethodCW { + public static void main(String[] args) { + new C().doSomething(); + } +} + +interface ICanGetSomething { + Object getSomething(); +} + +class B implements ICanGetSomething { + public Object getSomething() { // CE conflict here? + return new Object(); + } +} + +class C { + + C() { + new B().getSomething(); // 2 CW declared here + } + + static void staticMethod() { + new B().getSomething(); // 2 CW declared here + B b = new B(); + b.getSomething(); // 2 CW declared here + ICanGetSomething i = new B(); + i.getSomething(); // 2 CW declared here + } + void doSomething() { + Object result = new B().getSomething(); // 2 CW here + if (null == result) { + throw new Error("no result"); + } + } +} + +/** @testcase PR#40805 interface call signatures when declaring method in aspect */ +/* +aspect A { + // comment this out to get correct warnings + public Object ICanGetSomething.getSomething() { + return null; + } + declare warning : call(Object ICanGetSomething.getSomething()) + : "call ICanGetSomething.getSomething()"; + declare warning : call(Object getSomething()) + : "call getSomething()"; +} + +*/ |