Skip to content

add access to repeatable annotations that doesn't require an index - #678

Merged
Ladicek merged 1 commit into
smallrye:mainfrom
Ladicek:repeatable-annotation-access-without-index
May 28, 2026
Merged

Ladicek merged 1 commit into
smallrye:mainfrom
Ladicek:repeatable-annotation-access-without-index

Conversation

@Ladicek

@Ladicek Ladicek commented May 28, 2026

Copy link
Copy Markdown
Member

The following methods:

  • IndexView.getAnnotationsWithRepeatable()
  • AnnotationTarget.annotationsWithRepeatable()
  • AnnotationTarget.declaredAnnotationsWithRepeatable()
  • Type.annotationsWithRepeatable()

require an annotation name on the input, together with an index that is used to obtain the annotation class. If the annotation is repeatable, these methods also return all values of the container annotation.

Very often, when these methods are called, the user knows that the annotation is repeatable and has access to the name of the container annotation. For these cases, this commit adds overloads that accept an annotation name and a container annotation name, instead of an index. If the second annotation name does not name a container annotation for repeatable occurences of the first annotation name, the behavior of these overloads is undefined.

Fixes #663

The following methods:

- `IndexView.getAnnotationsWithRepeatable()`
- `AnnotationTarget.annotationsWithRepeatable()`
- `AnnotationTarget.declaredAnnotationsWithRepeatable()`
- `Type.annotationsWithRepeatable()`

require an annotation name on the input, together with an index that is used
to obtain the annotation class. If the annotation is repeatable, these methods
also return all values of the container annotation.

Very often, when these methods are called, the user _knows_ that the annotation
is repeatable and has access to the name of the container annotation. For these
cases, this commit adds overloads that accept an annotation name and a container
annotation name, instead of an index. If the second annotation name does not
name a container annotation for repeatable occurences of the first annotation
name, the behavior of these overloads is undefined.
@Ladicek Ladicek added this to the 3.6.0 milestone May 28, 2026
@Ladicek Ladicek added the breaking-change Changes that break API backwards compatibility label May 28, 2026
@Ladicek
Ladicek merged commit 4319fda into smallrye:main May 28, 2026
43 checks passed
@Ladicek
Ladicek deleted the repeatable-annotation-access-without-index branch May 28, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Changes that break API backwards compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

expose getAnnotationsWithRepeatable() that accepts the annotation name and the container annotation name

1 participant