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

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

View File

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

View File

@@ -743,7 +743,7 @@ public class CorsConfiguration {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}