Class identity comparisons wherever possible

Issue: SPR-12926
master
Juergen Hoeller 9 years ago
parent ea2843ecc0
commit 59b6600763
  1. 4
      spring-core/src/main/java/org/springframework/util/ClassUtils.java

@ -762,7 +762,7 @@ public abstract class ClassUtils {
*/
public static Method getMostSpecificMethod(Method method, Class<?> targetClass) {
if (method != null && isOverridable(method, targetClass) &&
targetClass != null && !targetClass.equals(method.getDeclaringClass())) {
targetClass != null && targetClass != method.getDeclaringClass()) {
try {
if (Modifier.isPublic(method.getModifiers())) {
try {
@ -914,7 +914,7 @@ public abstract class ClassUtils {
}
if (lhsType.isPrimitive()) {
Class<?> resolvedPrimitive = primitiveWrapperTypeMap.get(rhsType);
if (resolvedPrimitive != null && lhsType.equals(resolvedPrimitive)) {
if (lhsType == resolvedPrimitive) {
return true;
}
}

Loading…
Cancel
Save