Skip to content

Commit 89802cf

Browse files
committed
TypeDescriptor avoids merged annotations for equality comparisons
Issue: SPR-14926 Issue: SPR-14929
1 parent 637b638 commit 89802cf

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,9 @@ public boolean equals(Object obj) {
441441
if (!ObjectUtils.nullSafeEquals(getType(), other.getType())) {
442442
return false;
443443
}
444-
if (getAnnotations().length != other.getAnnotations().length) {
444+
if (!Arrays.equals(getAnnotations(), other.getAnnotations())) {
445445
return false;
446446
}
447-
for (Annotation ann : getAnnotations()) {
448-
if (!ann.equals(other.getAnnotation(ann.annotationType()))) {
449-
return false;
450-
}
451-
}
452447
if (isCollection() || isArray()) {
453448
return ObjectUtils.nullSafeEquals(getElementTypeDescriptor(), other.getElementTypeDescriptor());
454449
}

0 commit comments

Comments
 (0)