Merge pull request #10377 from dreis2211:cleanup-parametertypes-length

* pr/10377:
  Replace getParameterTypes().length with getParameterCount()
This commit is contained in:
Stephane Nicoll
2017-09-22 07:32:20 +02:00
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);