We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 13543f5 + 0cc6a9e commit 8f96712Copy full SHA for 8f96712
spring-core/src/main/java/org/springframework/util/ReflectionUtils.java
@@ -527,16 +527,8 @@ public static boolean isToStringMethod(@Nullable Method method) {
527
* Determine whether the given method is originally declared by {@link java.lang.Object}.
528
*/
529
public static boolean isObjectMethod(@Nullable Method method) {
530
- if (method == null) {
531
- return false;
532
- }
533
- try {
534
- Object.class.getDeclaredMethod(method.getName(), method.getParameterTypes());
535
- return true;
536
537
- catch (Exception ex) {
538
539
+ return (method != null && (method.getDeclaringClass() == Object.class ||
+ isEqualsMethod(method) || isHashCodeMethod(method) || isToStringMethod(method)));
540
}
541
542
/**
0 commit comments