]> source.dussan.org Git - aspectj.git/commitdiff
148508, 265418: tests and fixes: array and varargs subtype patterns
authoraclement <aclement>
Thu, 19 Feb 2009 21:04:45 +0000 (21:04 +0000)
committeraclement <aclement>
Thu, 19 Feb 2009 21:04:45 +0000 (21:04 +0000)
tests/bugs162/PR148508.java [deleted file]
tests/bugs164/PR148508.java [new file with mode: 0644]
tests/bugs164/pr265418/A.java [new file with mode: 0644]

diff --git a/tests/bugs162/PR148508.java b/tests/bugs162/PR148508.java
deleted file mode 100644 (file)
index 2269e67..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-
-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/bugs164/PR148508.java b/tests/bugs164/PR148508.java
new file mode 100644 (file)
index 0000000..081508c
--- /dev/null
@@ -0,0 +1,32 @@
+
+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.run();
+  }
+  
+  public void run() {
+         Object[] arr = new String[5];
+         boolean b = arr instanceof String[];
+    
+    
+    
+    //    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/bugs164/pr265418/A.java b/tests/bugs164/pr265418/A.java
new file mode 100644 (file)
index 0000000..b68ca4d
--- /dev/null
@@ -0,0 +1,29 @@
+public aspect A {
+
+  public static void a(Object... os) {}
+  public static void b(String... ss) {}
+  public static void c(Integer... is) {}
+
+  public static void d(Object[] os) {}
+  public static void e(String[] ss) {}
+  public static void f(Integer[] is) {}
+
+
+  before(Object[] args): call(* *(Object+...)) && args(args) {
+    System.out.println("varargs "+thisJoinPoint);
+  }
+
+  before(Object[] args): call(* *(Object+[])) && args(args) {
+    System.out.println("arrays  "+thisJoinPoint);
+  }
+
+  public static void main(String []argv) {
+    a();
+    b();
+    c();
+    d(null);
+    e(null);
+    f(null);
+  }
+
+}