diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java index 820d6eea7fd..5dd40c6df31 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration.java @@ -42,7 +42,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.context.event.GenericApplicationListener; import org.springframework.core.ResolvableType; -import org.springframework.lang.Nullable; import org.springframework.util.StringUtils; /** @@ -185,7 +184,7 @@ public class LocalDevToolsAutoConfiguration { } @Override - public boolean supportsSourceType(@Nullable Class sourceType) { + public boolean supportsSourceType(Class sourceType) { return true; } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleIdConverter.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleIdConverter.java index 9cc7ad7a500..d7912e26f1e 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleIdConverter.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/reactive/webclient/ExampleIdConverter.java @@ -23,7 +23,6 @@ import java.util.UUID; import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.GenericConverter; -import org.springframework.lang.Nullable; import org.springframework.stereotype.Component; /** @@ -39,9 +38,8 @@ public class ExampleIdConverter implements GenericConverter { return Collections.singleton(new ConvertiblePair(String.class, ExampleId.class)); } - @Nullable @Override - public Object convert(@Nullable Object source, TypeDescriptor sourceType, + public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java index 732b454ba4a..b0d11b79c8c 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/admin/SpringApplicationAdminMXBeanRegistrar.java @@ -40,7 +40,6 @@ import org.springframework.core.Ordered; import org.springframework.core.ResolvableType; import org.springframework.core.env.Environment; import org.springframework.core.env.StandardEnvironment; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** @@ -95,7 +94,7 @@ public class SpringApplicationAdminMXBeanRegistrar implements ApplicationContext } @Override - public boolean supportsSourceType(@Nullable Class sourceType) { + public boolean supportsSourceType(Class sourceType) { return true; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ArrayToDelimitedStringConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ArrayToDelimitedStringConverter.java index d457d6f345f..4c2d9b18c89 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ArrayToDelimitedStringConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/ArrayToDelimitedStringConverter.java @@ -24,7 +24,6 @@ import java.util.Set; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.ConditionalGenericConverter; -import org.springframework.lang.Nullable; import org.springframework.util.ObjectUtils; /** @@ -51,8 +50,7 @@ final class ArrayToDelimitedStringConverter implements ConditionalGenericConvert } @Override - @Nullable - public Object convert(@Nullable Object source, TypeDescriptor sourceType, + public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { List list = Arrays.asList(ObjectUtils.toObjectArray(source)); return this.delegate.convert(list, sourceType, targetType); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToArrayConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToArrayConverter.java index 581946fa544..9f5b4ea7fe3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToArrayConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToArrayConverter.java @@ -23,7 +23,6 @@ import java.util.Set; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.ConditionalGenericConverter; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -53,8 +52,7 @@ final class DelimitedStringToArrayConverter implements ConditionalGenericConvert } @Override - @Nullable - public Object convert(@Nullable Object source, TypeDescriptor sourceType, + public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToCollectionConverter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToCollectionConverter.java index 0b7670f5193..746dc7e7b39 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToCollectionConverter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/convert/DelimitedStringToCollectionConverter.java @@ -26,7 +26,6 @@ import org.springframework.core.CollectionFactory; import org.springframework.core.convert.ConversionService; import org.springframework.core.convert.TypeDescriptor; import org.springframework.core.convert.converter.ConditionalGenericConverter; -import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -56,8 +55,7 @@ final class DelimitedStringToCollectionConverter implements ConditionalGenericCo } @Override - @Nullable - public Object convert(@Nullable Object source, TypeDescriptor sourceType, + public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { if (source == null) { return null; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java index e6f82836995..971d8d54c24 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java @@ -66,7 +66,6 @@ import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ProtocolResolver; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; -import org.springframework.lang.Nullable; import org.springframework.mock.env.MockEnvironment; import org.springframework.stereotype.Component; import org.springframework.test.context.support.TestPropertySourceUtils; @@ -1785,7 +1784,6 @@ public class ConfigurationPropertiesTests { static class PersonConverter implements Converter { - @Nullable @Override public Person convert(String source) { String[] content = StringUtils.split(source, " "); @@ -1796,15 +1794,13 @@ public class ConfigurationPropertiesTests { static class GenericPersonConverter implements GenericConverter { - @Nullable @Override public Set getConvertibleTypes() { return Collections.singleton(new ConvertiblePair(String.class, Person.class)); } - @Nullable @Override - public Object convert(@Nullable Object source, TypeDescriptor sourceType, + public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) { String[] content = StringUtils.split((String) source, " "); return new Person(content[0], content[1]);