Annotate Object#equals parameter with @Nullable

Closes gh-23093
This commit is contained in:
Sebastien Deleuze
2019-06-06 14:18:12 +02:00
parent 33becd8258
commit 098ac0bbb8
158 changed files with 222 additions and 176 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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