Skip to content

Commit 9ce0df8

Browse files
committed
Support Class meta-annotation attributes with ASM
Prior to this commit, AnnotationAttributesReadingVisitor treated Class annotation attributes as Strings instead of Classes. As a result, look-ups for Class attributes in meta-annotations failed with an IllegalArgumentException. This commit fixes this issue by consistently treating Class attributes as Classes in AnnotationAttributesReadingVisitor. Issue: SPR-11557
1 parent 42690a9 commit 9ce0df8

File tree

5 files changed

+180
-168
lines changed

5 files changed

+180
-168
lines changed

spring-context/src/test/java/org/springframework/context/annotation/ComponentScanAnnotationIntegrationTests.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void viaContextRegistration_FromPackageOfConfigClass() {
109109
}
110110

111111
@Test
112-
public void viaContextRegistration_WithLocallyDeclaredComposedAnnotation() {
112+
public void viaContextRegistration_WithComposedAnnotation() {
113113
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
114114
ctx.register(ComposedAnnotationConfig.class);
115115
ctx.refresh();
@@ -122,19 +122,6 @@ public void viaContextRegistration_WithLocallyDeclaredComposedAnnotation() {
122122
ctx.containsBean("simpleComponent"), is(true));
123123
}
124124

125-
@Test
126-
public void viaContextRegistration_WithExternallyDeclaredComposedAnnotation() {
127-
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
128-
ctx.register(org.springframework.context.annotation.componentscan.meta.ComposedAnnotationConfig.class);
129-
ctx.refresh();
130-
ctx.getBean(org.springframework.context.annotation.componentscan.meta.ComposedAnnotationConfig.class);
131-
ctx.getBean(SimpleComponent.class);
132-
assertThat("config class bean not found", ctx.containsBeanDefinition("composedAnnotationConfig"), is(true));
133-
assertThat("@ComponentScan annotated @Configuration class registered directly against "
134-
+ "AnnotationConfigApplicationContext did not trigger component scanning as expected",
135-
ctx.containsBean("simpleComponent"), is(true));
136-
}
137-
138125
@Test
139126
public void viaBeanRegistration() {
140127
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();

0 commit comments

Comments
 (0)