Annotate Object#equals parameter with @Nullable
Closes gh-23093
This commit is contained in:
@@ -153,7 +153,7 @@ public final class ContentDisposition {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class HttpCookie {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1710,7 +1710,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ public abstract class HttpRange {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
@@ -330,7 +330,7 @@ public abstract class HttpRange {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public final class ResponseCookie extends HttpCookie {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ public class WebExchangeBindException extends ServerWebInputException implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || this.bindingResult.equals(other));
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ public class ServletContextResource extends AbstractFileResolvingResource implem
|
||||
* This implementation compares the underlying ServletContext resource locations.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class ControllerAdviceBean implements Ordered {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ public class HandlerMethod {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.springframework.core.io.AbstractResource;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -86,7 +87,7 @@ class MultipartFileResource extends AbstractResource {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof MultipartFileResource &&
|
||||
((MultipartFileResource) other).multipartFile.equals(this.multipartFile)));
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ final class HierarchicalUriComponents extends UriComponents {
|
||||
public void copyToUriComponentsBuilder(UriComponentsBuilder builder) {
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other);
|
||||
}
|
||||
@Override
|
||||
@@ -543,7 +543,7 @@ final class HierarchicalUriComponents extends UriComponents {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
@@ -890,7 +890,7 @@ final class HierarchicalUriComponents extends UriComponents {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof FullPathComponent &&
|
||||
getPath().equals(((FullPathComponent) other).getPath())));
|
||||
}
|
||||
@@ -964,7 +964,7 @@ final class HierarchicalUriComponents extends UriComponents {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof PathSegmentComponent &&
|
||||
getPathSegments().equals(((PathSegmentComponent) other).getPathSegments())));
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ final class OpaqueUriComponents extends UriComponents {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -420,7 +420,7 @@ public class PathPattern implements Comparable<PathPattern> {
|
||||
return this.parser.parse(file2 + (firstExtensionWild ? secondExtension : firstExtension));
|
||||
}
|
||||
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (!(other instanceof PathPattern)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user