Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

AnnotatedTypeMetadata's getMergedRepeatableAnnotationAttributes() method ignores classValuesAsString #31768

Closed
sbrannen opened this issue Dec 6, 2023 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Dec 6, 2023

The new getMergedRepeatableAnnotationAttributes() method introduced in Spring Framework 6.1 ignores the classValuesAsString argument, always supplying false to Adapt.values().

default Set<AnnotationAttributes> getMergedRepeatableAnnotationAttributes(
Class<? extends Annotation> annotationType, Class<? extends Annotation> containerType,
boolean classValuesAsString, boolean sortByReversedMetaDistance) {
Stream<MergedAnnotation<Annotation>> stream = getAnnotations().stream()
.filter(MergedAnnotationPredicates.typeIn(containerType, annotationType));
if (sortByReversedMetaDistance) {
stream = stream.sorted(reversedMetaDistance());
}
Adapt[] adaptations = Adapt.values(false, true);
return stream
.map(annotation -> annotation.asAnnotationAttributes(adaptations))
.flatMap(attributes -> {
if (containerType.equals(attributes.annotationType())) {
return Stream.of(attributes.getAnnotationArray(MergedAnnotation.VALUE));
}
return Stream.of(attributes);
})
.collect(Collectors.toCollection(LinkedHashSet::new));
}

Although it's rather unlikely that anyone is adversely affected by this at this point, I'm raising the issue for discoverability in the issue tracker, and I'll fix this for 6.1.2.

@sbrannen sbrannen added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) labels Dec 6, 2023
@sbrannen sbrannen added this to the 6.1.2 milestone Dec 6, 2023
@sbrannen sbrannen self-assigned this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant