Skip to content

Commit d3085e0

Browse files
committed
Perform low cost array length check before String comparisons
1 parent e90c7e2 commit d3085e0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ private AnnotationsScanner() {
350350

351351
private static boolean isOverride(Method rootMethod, Method candidateMethod) {
352352
return (!Modifier.isPrivate(candidateMethod.getModifiers()) &&
353+
candidateMethod.getParameterCount() == rootMethod.getParameterCount() &&
353354
candidateMethod.getName().equals(rootMethod.getName()) &&
354355
hasSameParameterTypes(rootMethod, candidateMethod));
355356
}

0 commit comments

Comments
 (0)