From e78e802647bbce575e6e4009b227291976c50ccb Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:17:32 +0100 Subject: [PATCH] =?UTF-8?q?Use=20JSpecify's=20@=E2=81=A0Nullable=20on=20ma?= =?UTF-8?q?in?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../expression/spel/VariableAndFunctionTests.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/spring-expression/src/test/java/org/springframework/expression/spel/VariableAndFunctionTests.java b/spring-expression/src/test/java/org/springframework/expression/spel/VariableAndFunctionTests.java index 4e5e22df0c5..b0178d144a7 100644 --- a/spring-expression/src/test/java/org/springframework/expression/spel/VariableAndFunctionTests.java +++ b/spring-expression/src/test/java/org/springframework/expression/spel/VariableAndFunctionTests.java @@ -18,6 +18,7 @@ import java.util.Set; +import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; @@ -30,7 +31,6 @@ import org.springframework.expression.spel.support.StandardEvaluationContext; import org.springframework.expression.spel.support.StandardTypeConverter; import org.springframework.expression.spel.support.StandardTypeLocator; -import org.springframework.lang.Nullable; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -344,15 +344,13 @@ record ArrayHolder(String... array) { static class ArrayHolderConverter implements GenericConverter { - @Nullable @Override - public Set getConvertibleTypes() { + public @Nullable Set getConvertibleTypes() { return Set.of(new ConvertiblePair(ArrayHolder.class, Object[].class)); } - @Nullable @Override - public String[] convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { + public @Nullable String[] convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { return ((ArrayHolder) source).array(); } }