Improve performance of JdkDynamicAopProxy.getProxy()
This commit is contained in:
committed by
Juergen Hoeller
parent
7bc8035989
commit
a033660425
@@ -505,12 +505,15 @@ public abstract class ReflectionUtils {
|
||||
* @see java.lang.Object#equals(Object)
|
||||
*/
|
||||
public static boolean isEqualsMethod(@Nullable Method method) {
|
||||
if (method == null || !method.getName().equals("equals")) {
|
||||
if (method == null) {
|
||||
return false;
|
||||
}
|
||||
if (method.getParameterCount() != 1) {
|
||||
return false;
|
||||
}
|
||||
if (!method.getName().equals("equals")) {
|
||||
return false;
|
||||
}
|
||||
return method.getParameterTypes()[0] == Object.class;
|
||||
}
|
||||
|
||||
@@ -519,7 +522,7 @@ public abstract class ReflectionUtils {
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
public static boolean isHashCodeMethod(@Nullable Method method) {
|
||||
return (method != null && method.getName().equals("hashCode") && method.getParameterCount() == 0);
|
||||
return method != null && method.getParameterCount() == 0 && method.getName().equals("hashCode");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -527,7 +530,7 @@ public abstract class ReflectionUtils {
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public static boolean isToStringMethod(@Nullable Method method) {
|
||||
return (method != null && method.getName().equals("toString") && method.getParameterCount() == 0);
|
||||
return (method != null && method.getParameterCount() == 0 && method.getName().equals("toString"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user