TypeDescriptor avoids merged annotations for equality comparisons

Issue: SPR-14926
Issue: SPR-14929
This commit is contained in:
Juergen Hoeller
2016-11-23 12:25:01 +01:00
parent 637b6387ea
commit 89802cfc11

View File

@@ -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());
}