From 9241e2ec7ae17268ce607df83855e067298820b5 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 5 Apr 2010 23:38:16 +0000 Subject: [PATCH] 291206: declare error/warning with type patterns --- tests/bugs169/pr291206/One.java | 17 +++++++++++++++++ tests/bugs169/pr291206/Three.java | 15 +++++++++++++++ tests/bugs169/pr291206/Two.java | 15 +++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 tests/bugs169/pr291206/One.java create mode 100644 tests/bugs169/pr291206/Three.java create mode 100644 tests/bugs169/pr291206/Two.java diff --git a/tests/bugs169/pr291206/One.java b/tests/bugs169/pr291206/One.java new file mode 100644 index 000000000..366d1faf1 --- /dev/null +++ b/tests/bugs169/pr291206/One.java @@ -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 index 000000000..dc926813d --- /dev/null +++ b/tests/bugs169/pr291206/Three.java @@ -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 index 000000000..aa15a12d5 --- /dev/null +++ b/tests/bugs169/pr291206/Two.java @@ -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 { + +} -- 2.39.5