Java 8 getParameterCount() instead of getParameterTypes().length

Issue: SPR-13188
This commit is contained in:
Juergen Hoeller
2016-07-07 01:04:24 +02:00
parent 39e3f2ebf6
commit a1f5fb53db
38 changed files with 68 additions and 68 deletions

View File

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

View File

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

View File

@@ -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;
}

View File

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