Skip to content

Commit d221202

Browse files
committed
Merge pull request #10377 from dreis2211:cleanup-parametertypes-length
* pr/10377: Replace getParameterTypes().length with getParameterCount()
2 parents 5f65bae + 5bb991e commit d221202

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private TypeExcludeFilter instantiateTypeExcludeFilter(Class<?> testClass,
6262
try {
6363
Constructor<?> constructor = getTypeExcludeFilterConstructor(filterClass);
6464
ReflectionUtils.makeAccessible(constructor);
65-
if (constructor.getParameterTypes().length == 1) {
65+
if (constructor.getParameterCount() == 1) {
6666
return (TypeExcludeFilter) constructor.newInstance(testClass);
6767
}
6868
return (TypeExcludeFilter) constructor.newInstance();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public T getObject() throws Exception {
142142
}
143143
Constructor<?>[] constructors = this.objectType.getDeclaredConstructors();
144144
for (Constructor<?> constructor : constructors) {
145-
if (constructor.getParameterTypes().length == 1
145+
if (constructor.getParameterCount() == 1
146146
&& constructor.getParameterTypes()[0]
147147
.isInstance(this.marshaller)) {
148148
ReflectionUtils.makeAccessible(constructor);

0 commit comments

Comments
 (0)