Merge branch '5.1.x'

This commit is contained in:
Juergen Hoeller 2019-04-03 19:05:42 +02:00
commit 8f967129b9
1 changed files with 2 additions and 10 deletions

View File

@ -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)));
}
/**