Skip to content

Commit 59b6600

Browse files
committed
Class identity comparisons wherever possible
Issue: SPR-12926
1 parent ea2843e commit 59b6600

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-core/src/main/java/org/springframework/util/ClassUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ public static boolean hasAtLeastOneMethodWithName(Class<?> clazz, String methodN
762762
*/
763763
public static Method getMostSpecificMethod(Method method, Class<?> targetClass) {
764764
if (method != null && isOverridable(method, targetClass) &&
765-
targetClass != null && !targetClass.equals(method.getDeclaringClass())) {
765+
targetClass != null && targetClass != method.getDeclaringClass()) {
766766
try {
767767
if (Modifier.isPublic(method.getModifiers())) {
768768
try {
@@ -914,7 +914,7 @@ public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) {
914914
}
915915
if (lhsType.isPrimitive()) {
916916
Class<?> resolvedPrimitive = primitiveWrapperTypeMap.get(rhsType);
917-
if (resolvedPrimitive != null && lhsType.equals(resolvedPrimitive)) {
917+
if (lhsType == resolvedPrimitive) {
918918
return true;
919919
}
920920
}

0 commit comments

Comments
 (0)