Fix #366085 concerning declared annotations with source retention #196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 fordeclare @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.