From e54ac87be2877bffb2bb107e0817403a2d4e62b4 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 3 Jun 2010 19:36:04 +0000 Subject: [PATCH] 315651 --- tests/bugs169/pr315651/test/Main.java | 12 ++++++++++++ tests/bugs169/pr315651/test/Profiling.aj | 17 +++++++++++++++++ .../aspectj/systemtest/ajc169/Ajc169Tests.java | 12 +++++++++--- .../org/aspectj/systemtest/ajc169/ajc169.xml | 5 +++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 tests/bugs169/pr315651/test/Main.java create mode 100644 tests/bugs169/pr315651/test/Profiling.aj diff --git a/tests/bugs169/pr315651/test/Main.java b/tests/bugs169/pr315651/test/Main.java new file mode 100644 index 000000000..c62c920b6 --- /dev/null +++ b/tests/bugs169/pr315651/test/Main.java @@ -0,0 +1,12 @@ + +package test; +public class Main { + + private static int plus(int first, int second){ + return first + second; + } + public static void main(String[] args) { + int num = plus(42,13); + System.out.println(num); + } +} diff --git a/tests/bugs169/pr315651/test/Profiling.aj b/tests/bugs169/pr315651/test/Profiling.aj new file mode 100644 index 000000000..2672a465e --- /dev/null +++ b/tests/bugs169/pr315651/test/Profiling.aj @@ -0,0 +1,17 @@ +package test; + +public aspect Profiling { + pointcut profile(): execution(* *.*(..)) ; + + private pointcut scope() : + if(condition()) + //&& !(execution(* *.condition())) <- uncomment and infinite loop disappears + && !cflow(execution(* *.condition())); + + public static boolean condition(){ + return (Math.random()<2); //always true + } + before(): profile() && scope() { + System.out.println("Entering method "+thisJoinPointStaticPart.getSignature()); + } +} diff --git a/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java b/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java index ee73f0fee..a350ed06c 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java @@ -18,17 +18,23 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc169Tests extends org.aspectj.testing.XMLBasedAjcTestCase { +// public void testClashingDeclareAnnos_313026_1() { +// runTest("clashing declare annos"); +// } + + public void testInfiniteLoop_pr315651() { + runTest("infinite loop"); + } + public void testAnnoType_pr314965() { runTest("anno typo"); } + public void testValidateBranchRecursion_314840() { runTest("validate branch recursion"); } - public void testClashingDeclareAnnos_313026_1() { - runTest("clashing declare annos"); - } public void testClassFileSize_312839_1() { runTest("class file size - 1"); diff --git a/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml b/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml index bf21ff9da..3e5ba7b0e 100644 --- a/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml +++ b/tests/src/org/aspectj/systemtest/ajc169/ajc169.xml @@ -2,6 +2,11 @@ + + + + + -- 2.39.5