RFR: 8322706: AnnotationTypeMismatchException in javac with annotation processing
Vicente Romero
vromero at openjdk.org
Tue Apr 15 20:27:46 UTC 2025
On Tue, 15 Apr 2025 15:11:04 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> Annotations are processed in a sequence of queues. But, it may happen this:
> - while running verification in `validateQ`, an annotation type is completed (when a default attribute value is an annotation, whose type has not been completed yet)
> - if this annotation type has attributes with default values, there will be temporary proxies created for the default values, and conversion of these default values to real values will be scheduled into `q`. `Annotate.flush()` will be called, but because flush is already running it will be ignored.
> - until there are more unrelated calls to `Annotate.flush()`, the temporary proxies will linger. If someone will try to use the default values for the attributes, they will get the proxies instead of the real values, leading to trouble.
>
> The proposal herein is to clear the queues in rounds as long as there are entries in the queues. An alternative might be to use a `PriorityQueue`, although that brings some complexity.
looks sensible
-------------
Marked as reviewed by vromero (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/24666#pullrequestreview-2769716998
More information about the compiler-dev
mailing list