Summary: | cryptic Internal compiler error with "declare @type" and RetentionPolicy.SOURCE | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | atao <pierre-m.raoul> |
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | aclement, Alexander |
Version: | 1.6.12 | ||
Target Milestone: | 1.9.19 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
atao
2011-12-08 13:38:26 EST
This old problem still occurs in AspectJ 1.9.9.1, see https://stackoverflow.com/q/74618269/1082681 In this case, the user tries to declare a Lombok @ToString annotation, see https://projectlombok.org/api/lombok/ToString Without having analysed the error, I am assuming it originates from the fact that the SOURCE retention causes the annotation to *not* be present during runtime - a special case which AJC or AJ weaver simply does not cover. Probably it would not be too difficult to put a safeguard into BcelWeaver.applyDeclareAtType or somewhere around there. For now, the weaver just throws this exception, which is annoying and should be fixed, but OTOH, it does not really make sense to paradoxically declare a source-level annotation on byte code. I have created a preliminary bugfix PR (yet to be reviewed): https://github.com/eclipse/org.aspectj/pull/196 There are no nice compiler warnings in it, but source-level annotation declarations are simply ignored (at least indirectly) by the weaver. @Andy Clement: Would you please be so kind to create a target milestone 1.9.19 for this issue? I do not have the necessary rights, as it seems. 1.9.19 now exists PR with workaround merged, follow-up issue https://github.com/eclipse/org.aspectj/issues/201 created. PR with workaround merged, follow-up issue https://github.com/eclipse/org.aspectj/issues/201 created. |