File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
spring-core/src/main/java/org/springframework/util Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -558,16 +558,8 @@ public static boolean isToStringMethod(@Nullable Method method) {
558
558
* Determine whether the given method is originally declared by {@link java.lang.Object}.
559
559
*/
560
560
public static boolean isObjectMethod (@ Nullable Method method ) {
561
- if (method == null ) {
562
- return false ;
563
- }
564
- try {
565
- Object .class .getDeclaredMethod (method .getName (), method .getParameterTypes ());
566
- return true ;
567
- }
568
- catch (Exception ex ) {
569
- return false ;
570
- }
561
+ return (method != null && (method .getDeclaringClass () == Object .class ||
562
+ isEqualsMethod (method ) || isHashCodeMethod (method ) || isToStringMethod (method )));
571
563
}
572
564
573
565
/**
You can’t perform that action at this time.
0 commit comments