Consistently declare Object::equals argument as @Nullable
This commit is contained in:
@@ -19,6 +19,7 @@ package org.springframework.test.web;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@XmlRootElement
|
||||
@@ -66,7 +67,7 @@ public class Person {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
@XmlRootElement
|
||||
class Person {
|
||||
|
||||
@@ -44,7 +46,7 @@ class Person {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user