Skip to content

Commit a06adf7

Browse files
committed
AnnotationMetadata returns Class values by default (again), allowing for explicit retrieval of String class names where preferred (SPR-5827)
1 parent bbd7fb3 commit a06adf7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

org.springframework.core/src/test/java/org/springframework/core/type/AnnotationMetadataTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ private void doTestAnnotationInfo(AnnotationMetadata metadata) {
7979
assertEquals("myScope", scopeAttrs.get("value"));
8080
Map<String, Object> specialAttrs = metadata.getAnnotationAttributes(SpecialAttr.class.getName());
8181
assertEquals(2, specialAttrs.size());
82-
assertEquals(String.class.getName(), specialAttrs.get("clazz"));
82+
assertEquals(String.class, specialAttrs.get("clazz"));
8383
assertEquals(Thread.State.NEW, specialAttrs.get("state"));
84+
Map<String, Object> specialAttrsString = metadata.getAnnotationAttributes(SpecialAttr.class.getName(), true);
85+
assertEquals(String.class.getName(), specialAttrsString .get("clazz"));
86+
assertEquals(Thread.State.NEW, specialAttrsString.get("state"));
8487
}
8588

8689
private void doTestMethodAnnotationInfo(AnnotationMetadata classMetadata) {

0 commit comments

Comments
 (0)