]> source.dussan.org Git - aspectj.git/commitdiff
315651
authoraclement <aclement>
Thu, 3 Jun 2010 19:36:04 +0000 (19:36 +0000)
committeraclement <aclement>
Thu, 3 Jun 2010 19:36:04 +0000 (19:36 +0000)
tests/bugs169/pr315651/test/Main.java [new file with mode: 0644]
tests/bugs169/pr315651/test/Profiling.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc169/Ajc169Tests.java
tests/src/org/aspectj/systemtest/ajc169/ajc169.xml

diff --git a/tests/bugs169/pr315651/test/Main.java b/tests/bugs169/pr315651/test/Main.java
new file mode 100644 (file)
index 0000000..c62c920
--- /dev/null
@@ -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 (file)
index 0000000..2672a46
--- /dev/null
@@ -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());
+       }
+}
index ee73f0fee212ea4cf5e50cd2655ed9355b8bb5dd..a350ed06c4e11b6eca43956edcee54ae269d10d1 100644 (file)
@@ -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");
index bf21ff9da3346c33302985dac1c65631da739952..3e5ba7b0ef070d41f550b54ec15a555f00d9b6d1 100644 (file)
@@ -2,6 +2,11 @@
 
 <suite>
 
+  <ajc-test dir="bugs169/pr315651" title="infinite loop">
+     <compile files="test/Profiling.aj test/Main.java" options="-1.5"/>
+     <run class="test.Main"/>
+  </ajc-test>
+
   <ajc-test dir="bugs169/pr314965" title="anno typo">
      <compile files="MinimalExample.java" options="-1.5">
        <message kind="warning" text="no match for this type name: AnnotationWithParamAndTypo [Xlint:invalidAbsoluteTypeName]"/>