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) {
483483 }
484484 if (anns .length > 0 ) {
485485 for (int i = 0 ; i < anns .length ; i ++) {
486- if (anns [i ] != otherAnns [i ]) {
486+ if (! annotationEquals ( anns [i ], otherAnns [i ]) ) {
487487 return false ;
488488 }
489489 }
490490 }
491491 return true ;
492492 }
493493
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+
494499 @ Override
495500 public int hashCode () {
496501 return getType ().hashCode ();
You can’t perform that action at this time.
0 commit comments