Browse Source

Remove redundant parameter count check in AnnotationsScanner.hasSameParameterTypes()

The redundancy was reported by @TAKETODAY.

See gh-34717
pull/35405/head
Sam Brannen 11 months ago
parent
commit
8c376e9cc5
  1. 6
      spring-core/src/main/java/org/springframework/core/annotation/AnnotationsScanner.java

6
spring-core/src/main/java/org/springframework/core/annotation/AnnotationsScanner.java

@ -361,16 +361,12 @@ abstract class AnnotationsScanner { @@ -361,16 +361,12 @@ abstract class AnnotationsScanner {
}
private static boolean hasSameParameterTypes(Method rootMethod, Method candidateMethod) {
if (candidateMethod.getParameterCount() != rootMethod.getParameterCount()) {
return false;
}
Class<?>[] rootParameterTypes = rootMethod.getParameterTypes();
Class<?>[] candidateParameterTypes = candidateMethod.getParameterTypes();
if (Arrays.equals(candidateParameterTypes, rootParameterTypes)) {
return true;
}
return hasSameGenericTypeParameters(rootMethod, candidateMethod,
rootParameterTypes);
return hasSameGenericTypeParameters(rootMethod, candidateMethod, rootParameterTypes);
}
private static boolean hasSameGenericTypeParameters(

Loading…
Cancel
Save