File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
spring-core/src/main/java/org/springframework/core/convert Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -483,14 +483,19 @@ private boolean annotationsMatch(TypeDescriptor otherDesc) {
483
483
}
484
484
if (anns .length > 0 ) {
485
485
for (int i = 0 ; i < anns .length ; i ++) {
486
- if (anns [i ] != otherAnns [i ]) {
486
+ if (! annotationEquals ( anns [i ], otherAnns [i ]) ) {
487
487
return false ;
488
488
}
489
489
}
490
490
}
491
491
return true ;
492
492
}
493
493
494
+ private boolean annotationEquals (Annotation ann , Annotation otherAnn ) {
495
+ // Annotation.equals is reflective and pretty slow, so let's check identity and proxy type first.
496
+ return (ann == otherAnn || (ann .getClass () == otherAnn .getClass () && ann .equals (otherAnn )));
497
+ }
498
+
494
499
@ Override
495
500
public int hashCode () {
496
501
return getType ().hashCode ();
You can’t perform that action at this time.
0 commit comments