aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs1919/366085/DeclareAnnotationsAspect.aj
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2022-12-04 16:16:37 +0100
committerAlexander Kriegisch <Alexander@Kriegisch.name>2022-12-21 20:57:39 +0700
commit65f1ec72c2fc9446a162780dc3f6dee625704c02 (patch)
tree2ed8eedb386b22f65b29c44ec90c9d33eb8ba64d /tests/bugs1919/366085/DeclareAnnotationsAspect.aj
parentb08d7d2a31f6d6444e4fea980a7d85f2944055b3 (diff)
downloadaspectj-65f1ec72c2fc9446a162780dc3f6dee625704c02.tar.gz
aspectj-65f1ec72c2fc9446a162780dc3f6dee625704c02.zip
Fix #366085 concerning declared annotations with source retention
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=366085. See https://stackoverflow.com/q/74618269/1082681. The issue described in the Bugzilla issue is about 'declare @type', but similar issues also existed for 'declare @field', 'declare @method', 'declare @constructor'. This fix is rather superficial and leaves things to be desired, because it is rather hacky and simply ignores errors source retention annotation declarations during weaving. A better fix would drop the corresponding declarations while parsing and also issue compiler warnings in each case. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/bugs1919/366085/DeclareAnnotationsAspect.aj')
-rw-r--r--tests/bugs1919/366085/DeclareAnnotationsAspect.aj13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/bugs1919/366085/DeclareAnnotationsAspect.aj b/tests/bugs1919/366085/DeclareAnnotationsAspect.aj
new file mode 100644
index 000000000..8fdc9460c
--- /dev/null
+++ b/tests/bugs1919/366085/DeclareAnnotationsAspect.aj
@@ -0,0 +1,13 @@
+public aspect DeclareAnnotationsAspect {
+ // These should be ignored, because @ToString has SOURCE retention
+ declare @type : Application : @ToString;
+ declare @method : * Application.*(..) : @ToString;
+ declare @constructor : Application.new(..) : @ToString;
+ declare @field : * Application.* : @ToString;
+
+ // These should be applied, because @Marker has RUNTIME retention
+ declare @type : Application : @Marker;
+ declare @method : * Application.*(..) : @Marker;
+ declare @constructor : Application.new(..) : @Marker;
+ declare @field : * Application.* : @Marker;
+}