]> source.dussan.org Git - aspectj.git/commitdiff
291206: declare error/warning with type patterns
authoraclement <aclement>
Mon, 5 Apr 2010 23:38:16 +0000 (23:38 +0000)
committeraclement <aclement>
Mon, 5 Apr 2010 23:38:16 +0000 (23:38 +0000)
tests/bugs169/pr291206/One.java [new file with mode: 0644]
tests/bugs169/pr291206/Three.java [new file with mode: 0644]
tests/bugs169/pr291206/Two.java [new file with mode: 0644]

diff --git a/tests/bugs169/pr291206/One.java b/tests/bugs169/pr291206/One.java
new file mode 100644 (file)
index 0000000..366d1fa
--- /dev/null
@@ -0,0 +1,17 @@
+import java.lang.annotation.*;
+
+aspect X {
+  declare warning: @Anno *: "Nothing should be annotated Anno!";
+}
+
+@Anno 
+class C {
+  
+}
+
+class D {
+  
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Anno {}
diff --git a/tests/bugs169/pr291206/Three.java b/tests/bugs169/pr291206/Three.java
new file mode 100644 (file)
index 0000000..dc92681
--- /dev/null
@@ -0,0 +1,15 @@
+import java.lang.annotation.*;
+
+aspect X {
+  declare error: I+ && !hasmethod(* foo(..)): "Missing foo() method in I subtype";
+}
+
+interface I {}
+
+class C implements I {
+  void foo() {}  
+}
+
+class D implements I {
+  
+}
diff --git a/tests/bugs169/pr291206/Two.java b/tests/bugs169/pr291206/Two.java
new file mode 100644 (file)
index 0000000..aa15a12
--- /dev/null
@@ -0,0 +1,15 @@
+import java.lang.annotation.*;
+
+aspect X {
+  declare warning: I+ && !hasmethod(* foo(..)): "Missing foo() method in I subtype";
+}
+
+interface I {}
+
+class C implements I {
+  void foo() {}  
+}
+
+class D implements I {
+  
+}