Consistently declare Object::equals argument as @Nullable

This commit is contained in:
Sam Brannen
2023-03-13 21:43:21 +01:00
parent a6dab10309
commit 00be19c647
74 changed files with 149 additions and 103 deletions

View File

@@ -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));
}
}