From 5f15c2a8e4afbf5aa7d554142732da58b5cec5f2 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 22 May 2009 19:35:20 +0000 Subject: [PATCH] 277508: more stable if_ method names --- tests/bugs165/pr277508/Basic.java | 20 +++++++++++++++++ tests/bugs165/pr277508/Basic2.java | 20 +++++++++++++++++ .../systemtest/ajc165/Ajc165Tests.java | 8 +++++++ .../org/aspectj/systemtest/ajc165/ajc165.xml | 22 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 tests/bugs165/pr277508/Basic.java create mode 100644 tests/bugs165/pr277508/Basic2.java 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 @@ + + + + + + + + + + + + + + + + + + + + + + -- 2.39.5