Replace getParameterTypes().length with getParameterCount()
Closes gh-10377
This commit is contained in:
committed by
Stephane Nicoll
parent
5f65baeb60
commit
5bb991ecaf
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user