Use RepeatableContainers.none() in AnnotationUtils
Update `AnnotationUtils` so that `RepeatableContainers.none()` is used
when performing an exhaustive search for merged annotations. These
parameters were accidentally removed in commit 210b1789 and weren't
caught earlier because we were missing a test.
Closes gh-22702
This commit is contained in:
@@ -979,6 +979,13 @@ public class AnnotationUtilsTests {
|
||||
assertEquals("value from synthesized component: ", "webController", synthesizedComponent.value());
|
||||
}
|
||||
|
||||
@Test // gh-22702
|
||||
public void findAnnotationWithRepeatablesElements() {
|
||||
assertNull(AnnotationUtils.findAnnotation(TestRepeatablesClass.class,
|
||||
TestRepeatable.class));
|
||||
assertNotNull(AnnotationUtils.findAnnotation(TestRepeatablesClass.class,
|
||||
TestRepeatableContainer.class));
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
static <T> T[] asArray(T... arr) {
|
||||
@@ -1808,4 +1815,21 @@ public class AnnotationUtilsTests {
|
||||
interface ContextConfigMismatch {
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Repeatable(TestRepeatableContainer.class)
|
||||
static @interface TestRepeatable {
|
||||
|
||||
String value();
|
||||
}
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
static @interface TestRepeatableContainer {
|
||||
|
||||
TestRepeatable[] value();
|
||||
}
|
||||
|
||||
@TestRepeatable("a")
|
||||
@TestRepeatable("b")
|
||||
static class TestRepeatablesClass {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user