Files
spring-framework/spring-core/src
Chengang Guan 5e7630469c Fix container detection in RepeatableContainers.standardRepeatables()
StandardRepeatableContainers.computeRepeatedAnnotationsMethod()
previously treated any annotation as a container annotation if it
merely declared a `value` attribute returning an array of a
@⁠Repeatable annotated type, without verifying that the repeatable
annotation actually references the candidate container via
@⁠Repeatable.value().

Consequently, an unrelated annotation that happened to have the same
shape as the official container (e.g. a "fake" container with a `value`
attribute returning the same repeatable type) was incorrectly
recognized as a container.

This commit aligns the detection logic with the Java language semantics
by additionally asserting that the container type declared in
@⁠Repeatable.value() is identical to the candidate annotation type.

Closes gh-37326

Signed-off-by: Chengang Guan <guanchengang@qq.com>
2026-09-30 17:41:07 +02:00
..