Java 8 getParameterCount() instead of getParameterTypes().length
Issue: SPR-13188
This commit is contained in:
@@ -93,7 +93,7 @@ public abstract class BridgeMethodResolver {
|
||||
private static boolean isBridgedCandidateFor(Method candidateMethod, Method bridgeMethod) {
|
||||
return (!candidateMethod.isBridge() && !candidateMethod.equals(bridgeMethod) &&
|
||||
candidateMethod.getName().equals(bridgeMethod.getName()) &&
|
||||
candidateMethod.getParameterTypes().length == bridgeMethod.getParameterTypes().length);
|
||||
candidateMethod.getParameterCount() == bridgeMethod.getParameterCount());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1682,7 +1682,7 @@ public abstract class AnnotationUtils {
|
||||
* @since 4.2
|
||||
*/
|
||||
static boolean isAttributeMethod(Method method) {
|
||||
return (method != null && method.getParameterTypes().length == 0 && method.getReturnType() != void.class);
|
||||
return (method != null && method.getParameterCount() == 0 && method.getReturnType() != void.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1692,7 +1692,7 @@ public abstract class AnnotationUtils {
|
||||
* @since 4.2
|
||||
*/
|
||||
static boolean isAnnotationTypeMethod(Method method) {
|
||||
return (method != null && method.getName().equals("annotationType") && method.getParameterTypes().length == 0);
|
||||
return (method != null && method.getName().equals("annotationType") && method.getParameterCount() == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -88,7 +88,7 @@ final class IdToEntityConverter implements ConditionalGenericConverter {
|
||||
}
|
||||
for (Method method : methods) {
|
||||
if (Modifier.isStatic(method.getModifiers()) && method.getName().equals(finderMethod) &&
|
||||
method.getParameterTypes().length == 1 && method.getReturnType().equals(entityClass) &&
|
||||
method.getParameterCount() == 1 && method.getReturnType().equals(entityClass) &&
|
||||
(localOnlyFiltered || method.getDeclaringClass().equals(entityClass))) {
|
||||
return method;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ public abstract class ReflectionUtils {
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
public static boolean isHashCodeMethod(Method method) {
|
||||
return (method != null && method.getName().equals("hashCode") && method.getParameterTypes().length == 0);
|
||||
return (method != null && method.getName().equals("hashCode") && method.getParameterCount() == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -392,7 +392,7 @@ public abstract class ReflectionUtils {
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public static boolean isToStringMethod(Method method) {
|
||||
return (method != null && method.getName().equals("toString") && method.getParameterTypes().length == 0);
|
||||
return (method != null && method.getName().equals("toString") && method.getParameterCount() == 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user