Integrated: 8322706: AnnotationTypeMismatchException in javac with annotation processing

Jan Lahoda jlahoda at openjdk.org
Wed Apr 16 11:47:00 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.

This pull request has now been integrated.

Changeset: 1ad869f8
Author:    Jan Lahoda <jlahoda at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/1ad869f8440cb274e474abd9f89f88db11101071
Stats:     168 lines in 2 files changed: 157 ins; 0 del; 11 mod

8322706: AnnotationTypeMismatchException in javac with annotation processing

Reviewed-by: vromero

-------------

PR: https://git.openjdk.org/jdk/pull/24666


More information about the compiler-dev mailing list