Browse Source

Merge branch '5.1.x'

pull/22737/head
Juergen Hoeller 6 years ago
parent
commit
8f967129b9
  1. 12
      spring-core/src/main/java/org/springframework/util/ReflectionUtils.java

12
spring-core/src/main/java/org/springframework/util/ReflectionUtils.java

@ -527,16 +527,8 @@ public abstract class ReflectionUtils { @@ -527,16 +527,8 @@ public abstract class ReflectionUtils {
* Determine whether the given method is originally declared by {@link java.lang.Object}.
*/
public static boolean isObjectMethod(@Nullable Method method) {
if (method == null) {
return false;
}
try {
Object.class.getDeclaredMethod(method.getName(), method.getParameterTypes());
return true;
}
catch (Exception ex) {
return false;
}
return (method != null && (method.getDeclaringClass() == Object.class ||
isEqualsMethod(method) || isHashCodeMethod(method) || isToStringMethod(method)));
}
/**

Loading…
Cancel
Save