aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndy Clement <aclement@gopivotal.com>2014-11-05 08:27:45 -0800
committerAndy Clement <aclement@gopivotal.com>2014-11-05 08:27:45 -0800
commit11fba64f400694713cc6571c97e194eaf3b99f40 (patch)
tree0c7501ff355c8caaecc2009864a423ad37d036e4 /tests
parente91fcabde7a38787ac03b5f98c6588aa8b3e411c (diff)
downloadaspectj-11fba64f400694713cc6571c97e194eaf3b99f40.tar.gz
aspectj-11fba64f400694713cc6571c97e194eaf3b99f40.zip
Fix 449739: support is(FinalType)
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs184/449739/Code.java20
-rw-r--r--tests/bugs184/449739/Code2.java20
-rw-r--r--tests/src/org/aspectj/systemtest/ajc184/Ajc184Tests.java9
-rw-r--r--tests/src/org/aspectj/systemtest/ajc184/ajc184.xml18
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">