summaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations/within_code/WithinAndWithinCodeTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5/annotations/within_code/WithinAndWithinCodeTests.java')
-rw-r--r--tests/java5/annotations/within_code/WithinAndWithinCodeTests.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/java5/annotations/within_code/WithinAndWithinCodeTests.java b/tests/java5/annotations/within_code/WithinAndWithinCodeTests.java
new file mode 100644
index 000000000..96ed0188d
--- /dev/null
+++ b/tests/java5/annotations/within_code/WithinAndWithinCodeTests.java
@@ -0,0 +1,14 @@
+public aspect WithinAndWithinCodeTests {
+
+ // should be two matches, L32 and L39
+ declare warning : execution(* doSomething(..)) && @within(@MyAnnotation)
+ : "@within match on non-inherited annotation";
+
+ // one match on L39
+ declare warning : execution(* doSomething(..)) && @within(@MyInheritableAnnotation)
+ : "@within match on inheritable annotation";
+
+ // one match on L32
+ declare warning : call(* doSomething(..)) && @withincode(@MyClassRetentionAnnotation)
+ : "@withincode match";
+} \ No newline at end of file