Replace getParameterTypes().length with getParameterCount()

Closes gh-10377
This commit is contained in:
dreis2211 2017-09-21 23:39:12 +02:00 committed by Stephane Nicoll
parent 5f65baeb60
commit 5bb991ecaf
2 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ class TypeExcludeFiltersContextCustomizer implements ContextCustomizer {
try {
Constructor<?> constructor = getTypeExcludeFilterConstructor(filterClass);
ReflectionUtils.makeAccessible(constructor);
if (constructor.getParameterTypes().length == 1) {
if (constructor.getParameterCount() == 1) {
return (TypeExcludeFilter) constructor.newInstance(testClass);
}
return (TypeExcludeFilter) constructor.newInstance();

View File

@ -142,7 +142,7 @@ public class JsonTestersAutoConfiguration {
}
Constructor<?>[] constructors = this.objectType.getDeclaredConstructors();
for (Constructor<?> constructor : constructors) {
if (constructor.getParameterTypes().length == 1
if (constructor.getParameterCount() == 1
&& constructor.getParameterTypes()[0]
.isInstance(this.marshaller)) {
ReflectionUtils.makeAccessible(constructor);