Skip to content

Commit 59b9404

Browse files
committed
Specify nullability @⁠Contract for TypeDescriptor.array()
1 parent 09d8e44 commit 59b9404

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ public static TypeDescriptor map(Class<?> mapType, @Nullable TypeDescriptor keyT
644644
* @since 3.2.1
645645
*/
646646
@Nullable
647+
@Contract("!null -> !null; null -> null")
647648
public static TypeDescriptor array(@Nullable TypeDescriptor elementTypeDescriptor) {
648649
if (elementTypeDescriptor == null) {
649650
return null;

spring-expression/src/main/java/org/springframework/expression/spel/support/ReflectionHelper.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ public static boolean convertAllMethodHandleArguments(TypeConverter converter, O
389389
// FunctionReference#executeFunctionViaMethodHandle().
390390
Class<?> varargsComponentClass = ClassUtils.resolvePrimitiveIfNecessary(varargsArrayClass.componentType());
391391
TypeDescriptor varargsArrayType = TypeDescriptor.array(TypeDescriptor.valueOf(varargsComponentClass));
392-
Assert.state(varargsArrayType != null, "Array type must not be null for a varargs array");
393392
TypeDescriptor varargsComponentType = varargsArrayType.getElementTypeDescriptor();
394393
Assert.state(varargsComponentType != null, "Component type must not be null for a varargs array");
395394

0 commit comments

Comments
 (0)