Specify nullability @Contract for TypeDescriptor.array()
This commit is contained in:
@@ -644,6 +644,7 @@ public class TypeDescriptor implements Serializable {
|
||||
* @since 3.2.1
|
||||
*/
|
||||
@Nullable
|
||||
@Contract("!null -> !null; null -> null")
|
||||
public static TypeDescriptor array(@Nullable TypeDescriptor elementTypeDescriptor) {
|
||||
if (elementTypeDescriptor == null) {
|
||||
return null;
|
||||
|
||||
@@ -389,7 +389,6 @@ public abstract class ReflectionHelper {
|
||||
// FunctionReference#executeFunctionViaMethodHandle().
|
||||
Class<?> varargsComponentClass = ClassUtils.resolvePrimitiveIfNecessary(varargsArrayClass.componentType());
|
||||
TypeDescriptor varargsArrayType = TypeDescriptor.array(TypeDescriptor.valueOf(varargsComponentClass));
|
||||
Assert.state(varargsArrayType != null, "Array type must not be null for a varargs array");
|
||||
TypeDescriptor varargsComponentType = varargsArrayType.getElementTypeDescriptor();
|
||||
Assert.state(varargsComponentType != null, "Component type must not be null for a varargs array");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user