Consistently declare Object::equals argument as @Nullable
This commit is contained in:
@@ -2251,7 +2251,7 @@ class SpelReproTests extends AbstractExpressionTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof TestClass2 &&
|
||||
this.string.equals(((TestClass2) other).string)));
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.expression.spel.testresources;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
///CLOVER:OFF
|
||||
public class PlaceOfBirth {
|
||||
|
||||
@@ -51,7 +53,7 @@ public class PlaceOfBirth {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (!(o instanceof PlaceOfBirth otherPOB)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user