Browse Source

Restore canonical name representation for 6.2

See gh-32405
pull/32474/head
Juergen Hoeller 2 years ago
parent
commit
2b56ca08d4
  1. 7
      spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java

7
spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java

@ -545,7 +545,7 @@ public class TypeDescriptor implements Serializable { @@ -545,7 +545,7 @@ public class TypeDescriptor implements Serializable {
public String toString() {
StringBuilder builder = new StringBuilder();
for (Annotation ann : getAnnotations()) {
builder.append('@').append(ann.annotationType().getName()).append(' ');
builder.append('@').append(getName(ann.annotationType())).append(' ');
}
builder.append(getResolvableType());
return builder.toString();
@ -733,6 +733,11 @@ public class TypeDescriptor implements Serializable { @@ -733,6 +733,11 @@ public class TypeDescriptor implements Serializable {
return new TypeDescriptor(property).nested(nestingLevel);
}
private static String getName(Class<?> clazz) {
String canonicalName = clazz.getCanonicalName();
return (canonicalName != null ? canonicalName : clazz.getName());
}
/**
* Adapter class for exposing a {@code TypeDescriptor}'s annotations as an

Loading…
Cancel
Save