Consistently declare Object::equals argument as @Nullable
This commit is contained in:
@@ -19,6 +19,7 @@ package org.springframework.http;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Default implementation of {@link HttpStatusCode}.
|
||||
@@ -89,7 +90,7 @@ final class DefaultHttpStatusCode
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
return (this == obj) || (obj instanceof HttpStatusCode that && this.value == that.value());
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ public final class HttpMethod implements Comparable<HttpMethod>, Serializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
return (this == obj) || (obj instanceof HttpMethod that && this.name.equals(that.name));
|
||||
}
|
||||
|
||||
|
||||
@@ -743,7 +743,7 @@ public class CorsConfiguration {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user