]> source.dussan.org Git - aspectj.git/commitdiff
testcode for 241861 and 148508
authoraclement <aclement>
Tue, 30 Sep 2008 20:10:11 +0000 (20:10 +0000)
committeraclement <aclement>
Tue, 30 Sep 2008 20:10:11 +0000 (20:10 +0000)
tests/bugs162/PR148508.java [new file with mode: 0644]
tests/bugs162/pr241861/Test.java [new file with mode: 0644]
tests/bugs162/pr241861/X.java [new file with mode: 0644]
tests/bugs162/pr241861/Y.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java
tests/src/org/aspectj/systemtest/ajc162/ajc162.xml

diff --git a/tests/bugs162/PR148508.java b/tests/bugs162/PR148508.java
new file mode 100644 (file)
index 0000000..2269e67
--- /dev/null
@@ -0,0 +1,23 @@
+
+aspect A {
+  pointcut broken1() : execution(* *(Object[]+));
+//  pointcut broken2(): execution(* *(*)) && args(Object[]+);
+
+  before(): broken1() { System.out.println("a"); }
+//  before(): broken2() { System.out.println("b"); }
+}
+
+public class PR148508 {
+  public static void main(String []argv) {
+    PR148508 instance = new PR148508();
+//    instance.m1(new Object[]{});
+    instance.m2(new Integer[]{});
+//    instance.m3(new String[]{});
+  }
+
+//  public void m1(Object[] os) { }
+  public void m2(Integer[] is) { }
+//  public void m3(String[] ss) { }
+
+}
diff --git a/tests/bugs162/pr241861/Test.java b/tests/bugs162/pr241861/Test.java
new file mode 100644 (file)
index 0000000..be9ca02
--- /dev/null
@@ -0,0 +1,9 @@
+class Test<O> {
+  O field;
+}
+
+class P {
+  public static void main(String[] argv) {
+     new Test<Integer>().field = 42;
+  }
+}
diff --git a/tests/bugs162/pr241861/X.java b/tests/bugs162/pr241861/X.java
new file mode 100644 (file)
index 0000000..e633386
--- /dev/null
@@ -0,0 +1,9 @@
+aspect Asp {
+  before(): execution(new(Integer,..)) {}
+}
+
+class Outer {
+  public class Inner {
+    Inner(Integer arg) {}
+  }
+}
diff --git a/tests/bugs162/pr241861/Y.java b/tests/bugs162/pr241861/Y.java
new file mode 100644 (file)
index 0000000..da4eb96
--- /dev/null
@@ -0,0 +1,9 @@
+aspect Asp {
+  before(): execution(new(String)) {}
+}
+
+class Outer {
+  public class Inner {
+    Inner(String arg) {}
+  }
+}
index 5ac0d8a106e26e5cba7ebab9b7a8bda06fc8f2d9..31fe77fed8b4d2a6fac6d1bf3cec0f0f24fd884a 100644 (file)
@@ -50,6 +50,10 @@ public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
                runTest("ltw perclause");
        }
 
+//     public void testParserProblemSubArrayPatterns_pr148508() {
+//             runTest("parser problem for array subtypes");
+//     }
+
        public void testNullDelegateForArray_pr247683() {
                runTest("null delegate for array");
        }
@@ -165,17 +169,17 @@ public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        }
 
        // public void testParamAnnosPipelining_pr241847() { runTest("param annos pipelining");}
-       // public void testParamAnnoInner_pr241861() {
-       // runTest("param annotation inner class");
-       // }
-       //
-       // public void testParamAnnoInner_pr241861_2() {
-       // runTest("param annotation inner class - 2");
-       // }
-       //
-       // public void testParamAnnoInner_pr241861_3() {
-       // runTest("param annotation inner class - 3");
-       // }
+       //public void testParamAnnoInner_pr241861() {
+       //      runTest("param annotation inner class");
+       //}
+//
+       //public void testParamAnnoInner_pr241861_2() {
+       //      runTest("param annotation inner class - 2");
+       //}
+//
+       //public void testParamAnnoInner_pr241861_3() {
+       //      runTest("param annotation inner class - 3");
+       //}
 
        public void testAnnotationDecp_pr239441() {
                runTest("annotation decp");
index bc1b177ed2cedf8754660faa258b7f0fab47011f..c05528c631d1dc4ea27b01faf3b07e80eedc460a 100644 (file)
@@ -3,6 +3,11 @@
 <!-- AspectJ v1.6.2 Tests -->
 <suite>
        
+   <ajc-test dir="bugs162" title="parser problem for array subtypes">
+     <compile files="PR148508.java"/>
+     <run class="PR148508">
+     </run>
+   </ajc-test>
        
    <ajc-test dir="bugs162/pr247683" title="null delegate for array">
      <compile options="-1.5" files="A.java"/>
     </ajc-test>    
 
     <ajc-test dir="bugs162/pr241861" title="param annotation inner class">
-        <compile files="Outer.java Ann.java Asp.java" options="-1.5">
-        </compile>
+     <compile files="Outer.java Ann.java Asp.java" options="-1.5 -showWeaveInfo">
+       <message kind="weave" text="Join point 'constructor-execution(void Outer$Inner.&lt;init&gt;(Outer, java.lang.String))' in Type 'Outer$Inner' (Outer.java:5) advised by before advice from 'Asp' (Asp.java:2)"/>
+     </compile>
     </ajc-test>    
     
     <ajc-test dir="bugs162/pr241861" title="param annotation inner class - 2">
         <compile files="X.java" options="-1.5 -showWeaveInfo">
-          <message kind="weave" text="fubar"/>
+          <message kind="weave" text="Join point 'constructor-execution(void Outer$Inner.&lt;init&gt;(Outer, java.lang.Integer))' in Type 'Outer$Inner' (X.java:7) advised by before advice from 'Asp' (X.java:2)"/>
         </compile>
     </ajc-test>    
     
     <ajc-test dir="bugs162/pr241861" title="param annotation inner class - 3">
         <compile files="Y.java" options="-1.5 -showWeaveInfo">
-          <message kind="weave" text="fubar"/>
+          <message kind="weave" text="Join point 'constructor-execution(void Outer$Inner.&lt;init&gt;(Outer, java.lang.String))' in Type 'Outer$Inner' (Y.java:7) advised by before advice from 'Asp' (Y.java:2)"/>
         </compile>
     </ajc-test>