eclipse-aspectj / aspectj

Other
303 stars 86 forks source link

Fix #366085 concerning declared annotations with source retention #196

Closed kriegaex closed 1 year ago

kriegaex commented 1 year ago

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.

@aclement, please do take some time to review this PR, before I merge in into the java-19 branch. Sorry for not creating a separate branch against master in this case, but in the Java 19 branch I already have the infrastructure for new tests and could just easily add it one more test case. By all means, if you can come up with a better way of solving this, I will be happy to drop this commit. You may also commit on top of this PR, if you choose to do so - whatever suits your needs.

kriegaex commented 1 year ago

I have started a manual build and test run for this PR branch here, because the PR is not against master and an automatic build is therefore not being triggered:

https://github.com/eclipse/org.aspectj/actions/runs/3614083565

Build AspectJ