Consistently declare Object::equals argument as @Nullable
This commit is contained in:
@@ -1651,7 +1651,7 @@ public abstract class AbstractAopProxyTests {
|
||||
public static class AllInstancesAreEqual implements IOther {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (other instanceof AllInstancesAreEqual);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextException;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
@@ -214,7 +215,7 @@ public class CglibProxyTests extends AbstractAopProxyTests implements Serializab
|
||||
return MethodMatcher.TRUE;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.testfixture.beans.IOther;
|
||||
import org.springframework.beans.testfixture.beans.ITestBean;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
@@ -197,7 +198,7 @@ public class JdkDynamicProxyTests extends AbstractAopProxyTests implements Seria
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.springframework.context.annotation6.Jsr330NamedForScanning;
|
||||
import org.springframework.context.testfixture.context.annotation.CglibConfiguration;
|
||||
import org.springframework.context.testfixture.context.annotation.LambdaBeanConfiguration;
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import static java.lang.String.format;
|
||||
@@ -732,7 +733,7 @@ class TestBean {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ package org.springframework.context.event.test;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* @author Stephane Nicoll
|
||||
*/
|
||||
@@ -35,7 +37,7 @@ public abstract class AbstractIdentifiable implements Identifiable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.context.event.test;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.core.ResolvableTypeProvider;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* A simple POJO that implements {@link ResolvableTypeProvider}.
|
||||
@@ -37,7 +38,7 @@ public class GenericEventPojo<T> implements ResolvableTypeProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.springframework.context.event.test;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* A basic test event that can be uniquely identified easily.
|
||||
@@ -49,7 +50,7 @@ public abstract class IdentifiableApplicationEvent extends ApplicationEvent impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ import javax.management.MBeanInfo;
|
||||
import javax.management.MBeanNotificationInfo;
|
||||
import javax.management.MBeanOperationInfo;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* @author Rob Harrop
|
||||
* @author Juergen Hoeller
|
||||
@@ -76,7 +78,7 @@ public class TestDynamicMBean implements DynamicMBean {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
return (obj instanceof TestDynamicMBean);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.beans.testfixture.beans.TestBean;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -288,7 +289,7 @@ public class ModelMapTests {
|
||||
public static class SomeInnerClass {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
return (obj instanceof SomeInnerClass);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user