Consistently declare Object::equals argument as @Nullable
This commit is contained in:
@@ -34,6 +34,7 @@ import org.springframework.core.convert.ConverterNotFoundException;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.core.convert.support.GenericConversionService;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
|
||||
import org.springframework.web.socket.ContextLoaderTestUtils;
|
||||
@@ -232,11 +233,8 @@ public class ConvertingEncoderDecoderSupportTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof MyType) {
|
||||
return ((MyType)obj).value.equals(value);
|
||||
}
|
||||
return false;
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
return (obj instanceof MyType that && this.value.equals(that.value));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user