aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2009-05-22 19:35:20 +0000
committeraclement <aclement>2009-05-22 19:35:20 +0000
commit5f15c2a8e4afbf5aa7d554142732da58b5cec5f2 (patch)
treea12f0ba8fadb240997d111785b154efdd14182d5 /tests
parentd32d58db8f91e29e61843afc9107a798f07901e9 (diff)
downloadaspectj-5f15c2a8e4afbf5aa7d554142732da58b5cec5f2.tar.gz
aspectj-5f15c2a8e4afbf5aa7d554142732da58b5cec5f2.zip
277508: more stable if_ method names
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs165/pr277508/Basic.java20
-rw-r--r--tests/bugs165/pr277508/Basic2.java20
-rw-r--r--tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java8
-rw-r--r--tests/src/org/aspectj/systemtest/ajc165/ajc165.xml22
4 files changed, 70 insertions, 0 deletions
diff --git a/tests/bugs165/pr277508/Basic.java b/tests/bugs165/pr277508/Basic.java
new file mode 100644
index 000000000..ec4e81568
--- /dev/null
+++ b/tests/bugs165/pr277508/Basic.java
@@ -0,0 +1,20 @@
+import java.lang.reflect.Method;
+
+public class Basic {
+ public static void main(String[] args) {
+ Method[] ms = X.class.getMethods();
+ for (int i = 0; i < ms.length; i++) {
+ if (ms[i].getName().indexOf("if$")!=-1) {
+ System.out.println("if method: "+ms[i]);
+ }
+ }
+}
+ public void m() {}
+}
+
+aspect X {
+ before(): execution(* m(..)) && if(true==true) && if(true==(true || true)) {
+ }
+ before(): execution(* m(..)) && if(true==true) {
+ }
+}
diff --git a/tests/bugs165/pr277508/Basic2.java b/tests/bugs165/pr277508/Basic2.java
new file mode 100644
index 000000000..73c151245
--- /dev/null
+++ b/tests/bugs165/pr277508/Basic2.java
@@ -0,0 +1,20 @@
+import java.lang.reflect.Method;
+
+public class Basic2 {
+
+ public static void main(String[] args) {
+ Method[] ms = X.class.getMethods();
+ for (int i = 0; i < ms.length; i++) {
+ if (ms[i].getName().indexOf("if$")!=-1) {
+ System.out.println("if method: "+ms[i]);
+ }
+ }
+}
+ public void m() {}
+}
+
+aspect X {
+ pointcut p(): execution(* m(..)) && if(true==true) && if(true==(true || true));
+ pointcut q(): execution(* m(..)) && if(true==true);
+
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java b/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java
index 94ad56940..9d1a6159b 100644
--- a/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc165/Ajc165Tests.java
@@ -20,6 +20,14 @@ import org.aspectj.weaver.LintMessage;
public class Ajc165Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testIfNames_pr277508() {
+ runTest("if method names");
+ }
+
+ public void testIfNames_pr277508_2() {
+ runTest("if method names - 2");
+ }
+
public void testDecAnnoMethod_pr275625() {
runTest("dec anno method");
}
diff --git a/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml b/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml
index 99ad49f0e..cacaf1b84 100644
--- a/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml
+++ b/tests/src/org/aspectj/systemtest/ajc165/ajc165.xml
@@ -2,6 +2,28 @@
<suite>
+ <ajc-test dir="bugs165/pr277508" title="if method names">
+ <compile files="Basic.java" options="-1.5"/>
+ <run class="Basic">
+ <stdout>
+ <line text="if method: public static final boolean X.ajc$if$1ba()"/>
+ <line text="if method: public static final boolean X.ajc$if$177()"/>
+ <line text="if method: public static final boolean X.ajc$if$165()"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs165/pr277508" title="if method names - 2">
+ <compile files="Basic2.java" options="-1.5"/>
+ <run class="Basic2">
+ <stdout>
+ <line text="if method: public static final boolean X.ajc$if$16d()"/>
+ <line text="if method: public static final boolean X.ajc$if$17f()"/>
+ <line text="if method: public static final boolean X.ajc$if$1c0()"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs165/pr275625" title="dec anno method">
<compile files="A.java" options="-1.5"/>
</ajc-test>