diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-11-05 08:27:45 -0800 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-11-05 08:27:45 -0800 |
commit | 11fba64f400694713cc6571c97e194eaf3b99f40 (patch) | |
tree | 0c7501ff355c8caaecc2009864a423ad37d036e4 /tests | |
parent | e91fcabde7a38787ac03b5f98c6588aa8b3e411c (diff) | |
download | aspectj-11fba64f400694713cc6571c97e194eaf3b99f40.tar.gz aspectj-11fba64f400694713cc6571c97e194eaf3b99f40.zip |
Fix 449739: support is(FinalType)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs184/449739/Code.java | 20 | ||||
-rw-r--r-- | tests/bugs184/449739/Code2.java | 20 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc184/Ajc184Tests.java | 9 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc184/ajc184.xml | 18 |
4 files changed, 67 insertions, 0 deletions
diff --git a/tests/bugs184/449739/Code.java b/tests/bugs184/449739/Code.java new file mode 100644 index 000000000..452c1d730 --- /dev/null +++ b/tests/bugs184/449739/Code.java @@ -0,0 +1,20 @@ +public class Code { + public static void main(String[] argv) { + new Code().run(); + } + + public void run() { + new Code2().run(); + } +} + +final class Code2 { + public void run() { + } +} + +aspect X { + before(): execution(* (!is(FinalType)).run(..)) { + System.out.println(thisJoinPointStaticPart); + } +} diff --git a/tests/bugs184/449739/Code2.java b/tests/bugs184/449739/Code2.java new file mode 100644 index 000000000..1ad0fee50 --- /dev/null +++ b/tests/bugs184/449739/Code2.java @@ -0,0 +1,20 @@ +public class Code2 { + public static void main(String[] argv) { + new Code2().run(); + } + + public void run() { + new Helper().run(); + } +} + +final class Helper { + public void run() { + } +} + +aspect X { + before(): execution(* (is(FinalType)).run(..)) { + System.out.println(thisJoinPointStaticPart); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc184/Ajc184Tests.java b/tests/src/org/aspectj/systemtest/ajc184/Ajc184Tests.java index 7ba5654ab..7e1265a0b 100644 --- a/tests/src/org/aspectj/systemtest/ajc184/Ajc184Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc184/Ajc184Tests.java @@ -97,6 +97,15 @@ public class Ajc184Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // abstract aspects runTest("thisAspectInstance - 15"); } + + public void testIsFinal_449739() { + runTest("is final"); + } + + public void testIsFinal_449739_2() { + runTest("is final - 2"); + } + // --- public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/ajc184/ajc184.xml b/tests/src/org/aspectj/systemtest/ajc184/ajc184.xml index 01d4d2312..3010ce169 100644 --- a/tests/src/org/aspectj/systemtest/ajc184/ajc184.xml +++ b/tests/src/org/aspectj/systemtest/ajc184/ajc184.xml @@ -133,6 +133,24 @@ </compile> </ajc-test> +<ajc-test dir="bugs184/449739" title="is final"> +<compile files="Code.java" options="-1.8"/> +<run class="Code"> + <stdout> + <line text="execution(void Code.run())"/> + </stdout> +</run> +</ajc-test> + +<ajc-test dir="bugs184/449739" title="is final - 2"> +<compile files="Code2.java" options="-1.8"/> +<run class="Code2"> + <stdout> + <line text="execution(void Helper.run())"/> + </stdout> +</run> +</ajc-test> + <ajc-test dir="bugs1612/pr239649" title="thisAspectInstance - 12"> <compile files="Twelve.java" options="-1.8"/> <run class="Twelve"> |