Browse Source

Remove unnecessary check in isBridgedCandidateFor()

In BridgeMethodResolver#isBridgedCandidateFor, candidateMethod is never
not bridged, so it's unnecessary to judge whether candidateMethod and
bridgeMethod are the same.

Closes gh-27862
pull/27927/head
v_vyqyxiong 4 years ago committed by Sam Brannen
parent
commit
6ecb488327
  1. 2
      spring-core/src/main/java/org/springframework/core/BridgeMethodResolver.java

2
spring-core/src/main/java/org/springframework/core/BridgeMethodResolver.java

@ -98,7 +98,7 @@ public final class BridgeMethodResolver { @@ -98,7 +98,7 @@ public final class BridgeMethodResolver {
* checks and can be used quickly filter for a set of possible matches.
*/
private static boolean isBridgedCandidateFor(Method candidateMethod, Method bridgeMethod) {
return (!candidateMethod.isBridge() && !candidateMethod.equals(bridgeMethod) &&
return (!candidateMethod.isBridge() &&
candidateMethod.getName().equals(bridgeMethod.getName()) &&
candidateMethod.getParameterCount() == bridgeMethod.getParameterCount());
}

Loading…
Cancel
Save