Skip to content

Remove Nullable annotation #15876

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
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;

/**
Expand Down Expand Up @@ -185,7 +184,7 @@ public boolean supportsEventType(ResolvableType eventType) {
}

@Override
public boolean supportsSourceType(@Nullable Class<?> sourceType) {
public boolean supportsSourceType(Class<?> sourceType) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
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;

/**
Expand All @@ -39,9 +38,8 @@ public Set<ConvertiblePair> getConvertibleTypes() {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
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;

/**
Expand Down Expand Up @@ -95,7 +94,7 @@ public boolean supportsEventType(ResolvableType eventType) {
}

@Override
public boolean supportsSourceType(@Nullable Class<?> sourceType) {
public boolean supportsSourceType(Class<?> sourceType) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
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;

/**
Expand All @@ -51,8 +50,7 @@ public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
}

@Override
@Nullable
public Object convert(@Nullable Object source, TypeDescriptor sourceType,
public Object convert(Object source, TypeDescriptor sourceType,
TypeDescriptor targetType) {
List<Object> list = Arrays.asList(ObjectUtils.toObjectArray(source));
return this.delegate.convert(list, sourceType, targetType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
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;

Expand Down Expand Up @@ -53,8 +52,7 @@ public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
}

@Override
@Nullable
public Object convert(@Nullable Object source, TypeDescriptor sourceType,
public Object convert(Object source, TypeDescriptor sourceType,
TypeDescriptor targetType) {
if (source == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
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;

Expand Down Expand Up @@ -56,8 +55,7 @@ public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
}

@Override
@Nullable
public Object convert(@Nullable Object source, TypeDescriptor sourceType,
public Object convert(Object source, TypeDescriptor sourceType,
TypeDescriptor targetType) {
if (source == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
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;
Expand Down Expand Up @@ -1785,7 +1784,6 @@ public void validate(Object target, Errors errors) {

static class PersonConverter implements Converter<String, Person> {

@Nullable
@Override
public Person convert(String source) {
String[] content = StringUtils.split(source, " ");
Expand All @@ -1796,15 +1794,13 @@ public Person convert(String source) {

static class GenericPersonConverter implements GenericConverter {

@Nullable
@Override
public Set<ConvertiblePair> 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]);
Expand Down