diff options
author | aclement <aclement> | 2010-11-27 06:23:20 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-11-27 06:23:20 +0000 |
commit | 03de7d656faafc1ac55d9994b9e311c860d97a52 (patch) | |
tree | 6696b7e8ae038a8b1f294b475437115992b6dd6b /tests/features1611/declareMinus | |
parent | f55ef741d7246cfac8f5c02754c0e4c9698fd310 (diff) | |
download | aspectj-03de7d656faafc1ac55d9994b9e311c860d97a52.tar.gz aspectj-03de7d656faafc1ac55d9994b9e311c860d97a52.zip |
annotation removal - extra checks
Diffstat (limited to 'tests/features1611/declareMinus')
-rw-r--r-- | tests/features1611/declareMinus/Unsupported.java | 24 | ||||
-rw-r--r-- | tests/features1611/declareMinus/WithValues.java | 22 |
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/features1611/declareMinus/Unsupported.java b/tests/features1611/declareMinus/Unsupported.java new file mode 100644 index 000000000..4275b5aec --- /dev/null +++ b/tests/features1611/declareMinus/Unsupported.java @@ -0,0 +1,24 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { + String foo(); +} + +@Anno(foo="anc") +aspect X { + + //declare @method: int i: -@Anno; + declare @method: int i(..): -@Anno; + declare @type: X: -@Anno; + declare @field: int i: -@Anno(foo="abc"); + + public static void main(String[] args) throws Exception { + if (X.class.getDeclaredField("i").getAnnotation(Anno.class)==null) { + System.out.println("not there"); + } else { + System.out.println("failed"); + } + } +}
\ No newline at end of file diff --git a/tests/features1611/declareMinus/WithValues.java b/tests/features1611/declareMinus/WithValues.java new file mode 100644 index 000000000..a756c2e23 --- /dev/null +++ b/tests/features1611/declareMinus/WithValues.java @@ -0,0 +1,22 @@ +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface Anno { + String foo(); +} + +public aspect WithValues { + @Anno(foo="anc") + int i; + + declare @field: int i: -@Anno; + + public static void main(String[] args) throws Exception { + if (WithValues.class.getDeclaredField("i").getAnnotation(Anno.class)==null) { + System.out.println("not there"); + } else { + System.out.println("failed"); + } + } +}
\ No newline at end of file |