]> source.dussan.org Git - aspectj.git/commitdiff
209831: testcode
authoraclement <aclement>
Thu, 21 Feb 2008 03:16:45 +0000 (03:16 +0000)
committeraclement <aclement>
Thu, 21 Feb 2008 03:16:45 +0000 (03:16 +0000)
tests/bugs160/pr209831/Test.java [new file with mode: 0644]
tests/bugs160/pr209831/Test2.java [new file with mode: 0644]

diff --git a/tests/bugs160/pr209831/Test.java b/tests/bugs160/pr209831/Test.java
new file mode 100644 (file)
index 0000000..f5d19a1
--- /dev/null
@@ -0,0 +1,40 @@
+import java.lang.annotation.*;
+
+ aspect ExactAnnotationTypePatternBug {
+
+  before(Throwable e) : handler(Throwable+)  && args(e) &&
+!args(@NoDefaultHandler Throwable+) {
+
+  }
+}
+
+
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.PARAMETER)
+ @interface NoDefaultHandler {
+}
+
+public class Test {
+
+  /**
+   * @param args
+   */
+  public static void main(String[] args) {
+    // TODO Auto-generated method stub
+
+  }
+
+  private void th() throws Throwable {
+    throw new Throwable();
+  }
+
+  private void test() {
+    try {
+      th();
+    } catch (Throwable e) {
+
+    }
+  }
+
+}
+
diff --git a/tests/bugs160/pr209831/Test2.java b/tests/bugs160/pr209831/Test2.java
new file mode 100644 (file)
index 0000000..39b64a1
--- /dev/null
@@ -0,0 +1,45 @@
+import java.lang.annotation.*;
+
+ aspect ExactAnnotationTypePatternBug {
+
+  before(Throwable e) : handler(Throwable+)  && args(e) &&
+!args(@NoDefaultHandler Throwable+) {
+
+  }
+}
+
+
+@Retention(RetentionPolicy.CLASS)
+//@Target(ElementType.PARAMETER)
+ @interface NoDefaultHandler {
+}
+
+@NoDefaultHandler
+class MyException extends Throwable {
+       
+}
+
+public class Test2 {
+
+  /**
+   * @param args
+   */
+  public static void main(String[] args) {
+    // TODO Auto-generated method stub
+
+  }
+
+  private void th() throws MyException {
+    throw new MyException();
+  }
+
+  private void test() {
+    try {
+      th();
+    } catch (MyException e) {
+
+    }
+  }
+
+}
+