diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-12-04 16:16:37 +0100 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2022-12-21 20:57:39 +0700 |
commit | 65f1ec72c2fc9446a162780dc3f6dee625704c02 (patch) | |
tree | 2ed8eedb386b22f65b29c44ec90c9d33eb8ba64d /tests/src | |
parent | b08d7d2a31f6d6444e4fea980a7d85f2944055b3 (diff) | |
download | aspectj-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/src')
-rw-r--r-- | tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java | 4 | ||||
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml | 12 |
2 files changed, 11 insertions, 5 deletions
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java index 38441267e..3c921f51a 100644 --- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java +++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java @@ -15,8 +15,8 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class Bugs1919Tests extends XMLBasedAjcTestCase { - public void testDummyBug() { - //runTest("dummy Java 19 bug"); + public void testDeclareAnnotationWithSourceRetention() { + runTest("declare annotation with SOURCE retention"); } public static Test suite() { diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml index 3741b338c..eaeca7143 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml @@ -162,8 +162,14 @@ </run> </ajc-test> - <!-- Currently, there are no bugfixes with tests in this AspectJ vesion --> - <ajc-test dir="bugs1919/github_99999" vm="19" title="dummy Java 19"> - </ajc-test> + <!-- Weaver error when declaring annotation with SOURCE retention, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=366085 --> + <ajc-test dir="bugs1919/366085" vm="1.5" title="declare annotation with SOURCE retention"> + <compile files="Application.java DeclareAnnotationsAspect.aj ToString.java Marker.java" options="-1.5 -showWeaveInfo"> + <message kind="weave" text="'Application' (Application.java:1) is annotated with @Marker type annotation from 'DeclareAnnotationsAspect'"/> + <message kind="weave" text="'public void Application.new(int)' (Application.java:4) is annotated with @Marker constructor annotation from 'DeclareAnnotationsAspect'"/> + <message kind="weave" text="'public int Application.getNumber()' (Application.java:8) is annotated with @Marker method annotation from 'DeclareAnnotationsAspect'"/> + <message kind="weave" text="'public int number' of type 'Application' (Application.java) is annotated with @Marker field annotation from 'DeclareAnnotationsAspect'"/> + </compile> + </ajc-test> </suite> |