TypeDescriptor avoids merged annotations for equality comparisons

Issue: SPR-14926
Issue: SPR-14929
master
Juergen Hoeller 8 years ago
parent 637b6387ea
commit 89802cfc11
  1. 7
      spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java

@ -441,14 +441,9 @@ public class TypeDescriptor implements Serializable {
if (!ObjectUtils.nullSafeEquals(getType(), other.getType())) {
return false;
}
if (getAnnotations().length != other.getAnnotations().length) {
if (!Arrays.equals(getAnnotations(), other.getAnnotations())) {
return false;
}
for (Annotation ann : getAnnotations()) {
if (!ann.equals(other.getAnnotation(ann.annotationType()))) {
return false;
}
}
if (isCollection() || isArray()) {
return ObjectUtils.nullSafeEquals(getElementTypeDescriptor(), other.getElementTypeDescriptor());
}

Loading…
Cancel
Save