diff --git a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java index 96c9b02ac0a8..9d3fa0dcf54b 100644 --- a/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java +++ b/spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java @@ -511,16 +511,12 @@ public int hashCode() { public String toString() { StringBuilder builder = new StringBuilder(); for (Annotation ann : getAnnotations()) { - builder.append('@').append(getName(ann.annotationType())).append(' '); + builder.append('@').append(ann.annotationType().getName()).append(' '); } builder.append(getResolvableType()); return builder.toString(); } - private static String getName(Class clazz) { - String canonicalName = clazz.getCanonicalName(); - return (canonicalName != null ? canonicalName : clazz.getName()); - } /** * Create a new type descriptor for an object. @@ -802,7 +798,7 @@ public int hashCode() { @Override public String toString() { - return "AnnotatedElementAdapter annotations=" + Arrays.toString(this.annotations); + return Arrays.toString(this.annotations); } }