Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix losing type annotations with different visibility #492

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented Feb 6, 2025

In case a single type annotation target (such as a MethodInfo) has multiple type annotations, some of them runtime-retained and some class-retained, all annotations of one kind are lost.

This is because Indexer.processTypeAnnotations() was written with the assumption that it is only called once for any given target. This was true in Jandex 2, which only supported runtime-retained annotations, but since Jandex 3.0, class-retained annotations are supported as well. Hence, the method can legally be called twice for any given target.

Fortunately, this issue doesn't exist for non-type annotations.

In case a single type annotation target (such as a `MethodInfo`)
has multiple type annotations, some of them runtime-retained and
some class-retained, all annotations of one kind are lost.

This is because `Indexer.processTypeAnnotations()` was written with
the assumption that it is only called once for any given target.
This was true in Jandex 2, which only supported runtime-retained
annotations, but since Jandex 3.0, class-retained annotations are
supported as well. Hence, the method can legally be called twice
for any given target.

Fortunately, this issue doesn't exist for non-type annotations.
@Ladicek Ladicek added this to the 3.2.5 milestone Feb 6, 2025
@Ladicek Ladicek merged commit ca07c5f into smallrye:main Feb 6, 2025
35 checks passed
@Ladicek Ladicek deleted the fix-losing-type-annotations-with-different-visibility branch February 6, 2025 14:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant