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 @@ -479,14 +479,19 @@ private boolean annotationsMatch(TypeDescriptor otherDesc) {
479
479
}
480
480
if (anns .length > 0 ) {
481
481
for (int i = 0 ; i < anns .length ; i ++) {
482
- if (anns [i ] != otherAnns [i ]) {
482
+ if (! annotationEquals ( anns [i ], otherAnns [i ]) ) {
483
483
return false ;
484
484
}
485
485
}
486
486
}
487
487
return true ;
488
488
}
489
489
490
+ private boolean annotationEquals (Annotation ann , Annotation otherAnn ) {
491
+ // Annotation.equals is reflective and pretty slow, so let's check identity and proxy type first.
492
+ return (ann == otherAnn || (ann .getClass () == otherAnn .getClass () && ann .equals (otherAnn )));
493
+ }
494
+
490
495
@ Override
491
496
public int hashCode () {
492
497
return getType ().hashCode ();
You can’t perform that action at this time.
0 commit comments