Repository navigation
add access to repeatable annotations that doesn't require an index - #678
Merged
Ladicek merged 1 commit intoMay 28, 2026
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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