TypeDescriptor equals implementation accepts annotations in any order (SPR-9084)

This commit is contained in:
Juergen Hoeller
2012-02-11 19:13:45 +01:00
parent 9470323724
commit 9e21d2f741

View File

@@ -547,13 +547,12 @@ public class TypeDescriptor {
if (!ObjectUtils.nullSafeEquals(getType(), other.getType())) {
return false;
}
Annotation[] ann = getAnnotations();
Annotation[] otherAnn = other.getAnnotations();
if (ann.length != otherAnn.length) {
Annotation[] annotations = getAnnotations();
if (annotations.length != other.getAnnotations().length) {
return false;
}
for (int i = 0; i < ann.length; i++) {
if (!ann[i].annotationType().equals(otherAnn[i].annotationType())) {
for (Annotation ann : annotations) {
if (other.getAnnotation(ann.annotationType()) == null) {
return false;
}
}