Replace getParameterTypes().length with getParameterCount()
Closes gh-10377
This commit is contained in:
parent
5f65baeb60
commit
5bb991ecaf
|
|
@ -62,7 +62,7 @@ class TypeExcludeFiltersContextCustomizer implements ContextCustomizer {
|
||||||
try {
|
try {
|
||||||
Constructor<?> constructor = getTypeExcludeFilterConstructor(filterClass);
|
Constructor<?> constructor = getTypeExcludeFilterConstructor(filterClass);
|
||||||
ReflectionUtils.makeAccessible(constructor);
|
ReflectionUtils.makeAccessible(constructor);
|
||||||
if (constructor.getParameterTypes().length == 1) {
|
if (constructor.getParameterCount() == 1) {
|
||||||
return (TypeExcludeFilter) constructor.newInstance(testClass);
|
return (TypeExcludeFilter) constructor.newInstance(testClass);
|
||||||
}
|
}
|
||||||
return (TypeExcludeFilter) constructor.newInstance();
|
return (TypeExcludeFilter) constructor.newInstance();
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ public class JsonTestersAutoConfiguration {
|
||||||
}
|
}
|
||||||
Constructor<?>[] constructors = this.objectType.getDeclaredConstructors();
|
Constructor<?>[] constructors = this.objectType.getDeclaredConstructors();
|
||||||
for (Constructor<?> constructor : constructors) {
|
for (Constructor<?> constructor : constructors) {
|
||||||
if (constructor.getParameterTypes().length == 1
|
if (constructor.getParameterCount() == 1
|
||||||
&& constructor.getParameterTypes()[0]
|
&& constructor.getParameterTypes()[0]
|
||||||
.isInstance(this.marshaller)) {
|
.isInstance(this.marshaller)) {
|
||||||
ReflectionUtils.makeAccessible(constructor);
|
ReflectionUtils.makeAccessible(constructor);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue