Browse Source

Replace getParameterTypes().length with getParameterCount()

Closes gh-10377
pull/9625/head
dreis2211 8 years ago committed by Stephane Nicoll
parent
commit
5bb991ecaf
  1. 2
      spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFiltersContextCustomizer.java
  2. 2
      spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java

2
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFiltersContextCustomizer.java

@ -62,7 +62,7 @@ class TypeExcludeFiltersContextCustomizer implements ContextCustomizer { @@ -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();

2
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTestersAutoConfiguration.java

@ -142,7 +142,7 @@ public class JsonTestersAutoConfiguration { @@ -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);

Loading…
Cancel
Save