Use Class#componentType() for consistency with arrayType()
Java 12 introduced java.lang.Class#componentType() as a shortcut for
getComponentType().
Since we started using arrayType() in fe5560400c, this commit switches
to componentType() for consistent API usage style.
This commit is contained in:
@@ -344,7 +344,7 @@ public class WebDataBinder extends DataBinder {
|
||||
}
|
||||
else if (fieldType.isArray()) {
|
||||
// Special handling of array property.
|
||||
return Array.newInstance(fieldType.getComponentType(), 0);
|
||||
return Array.newInstance(fieldType.componentType(), 0);
|
||||
}
|
||||
else if (Collection.class.isAssignableFrom(fieldType)) {
|
||||
return CollectionFactory.createCollection(fieldType, 0);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -157,7 +157,7 @@ public final class MultipartResolutionDelegate {
|
||||
}
|
||||
|
||||
private static boolean isMultipartFileArray(MethodParameter methodParam) {
|
||||
return (MultipartFile.class == methodParam.getNestedParameterType().getComponentType());
|
||||
return (MultipartFile.class == methodParam.getNestedParameterType().componentType());
|
||||
}
|
||||
|
||||
private static boolean isPartCollection(MethodParameter methodParam) {
|
||||
@@ -165,7 +165,7 @@ public final class MultipartResolutionDelegate {
|
||||
}
|
||||
|
||||
private static boolean isPartArray(MethodParameter methodParam) {
|
||||
return (Part.class == methodParam.getNestedParameterType().getComponentType());
|
||||
return (Part.class == methodParam.getNestedParameterType().componentType());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user