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

@@ -18,6 +18,8 @@ package org.springframework.web.servlet.tags.form;
import java.beans.PropertyEditorSupport;
import org.springframework.lang.Nullable;
/**
* @author Juergen Hoeller
*/
@@ -42,7 +44,7 @@ public class ItemPet {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -29,6 +29,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.propertyeditors.StringArrayPropertyEditor;
import org.springframework.beans.testfixture.beans.Colour;
import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.web.servlet.support.BindStatus;
@@ -555,7 +556,7 @@ class OptionTagTests extends AbstractHtmlElementTagTests {
}
@Override
public boolean equals(Object obj) {
public boolean equals(@Nullable Object obj) {
if (obj instanceof RulesVariant other) {
return this.toId().equals(other.toId());
}