Annotate Object#equals parameter with @Nullable
Closes gh-23093
This commit is contained in:
@@ -81,7 +81,7 @@ public class BeanMetadataAttribute implements BeanMetadataElement {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof PropertyDescriptor &&
|
||||
PropertyDescriptorUtils.equals(this, (PropertyDescriptor) other)));
|
||||
}
|
||||
@@ -491,7 +491,7 @@ class ExtendedBeanInfo implements BeanInfo {
|
||||
* See java.beans.IndexedPropertyDescriptor#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ final class GenericTypeAwarePropertyDescriptor extends PropertyDescriptor {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ public class MutablePropertyValues implements PropertyValues, Serializable {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof MutablePropertyValues &&
|
||||
this.propertyValueList.equals(((MutablePropertyValues) other).propertyValueList)));
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ public class PropertyValue extends BeanMetadataAttributeAccessor implements Seri
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ public class InjectionPoint {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ public class InitDestroyAnnotationBeanPostProcessor
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ public class InjectionMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class BeanDefinitionHolder implements BeanMetadataElement {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class BeanExpressionContext {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ public class ConstructorArgumentValues {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class RuntimeBeanNameReference implements BeanReference {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ public class RuntimeBeanReference implements BeanReference {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ public class TypedStringValue implements BeanMetadataElement {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class BeanComponentDefinition extends BeanDefinitionHolder implements Com
|
||||
* as well, in addition to the superclass's equality requirements.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof BeanComponentDefinition && super.equals(other)));
|
||||
}
|
||||
|
||||
|
||||
@@ -1152,7 +1152,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
|
||||
public abstract AbstractBeanDefinition cloneBeanDefinition();
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.io.InputStream;
|
||||
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.core.io.AbstractResource;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -80,7 +81,7 @@ class BeanDefinitionResource extends AbstractResource {
|
||||
* This implementation compares the underlying BeanDefinition.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof BeanDefinitionResource &&
|
||||
((BeanDefinitionResource) other).beanDefinition.equals(this.beanDefinition)));
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ public class CglibSubclassingInstantiationStrategy extends SimpleInstantiationSt
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (getClass() == other.getClass() &&
|
||||
this.beanDefinition.equals(((CglibIdentitySupport) other).beanDefinition));
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class ChildBeanDefinition extends AbstractBeanDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class GenericBeanDefinition extends AbstractBeanDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof GenericBeanDefinition && super.equals(other)));
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class LookupOverride extends MethodOverride {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (!(other instanceof LookupOverride) || !super.equals(other)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public abstract class MethodOverride implements BeanMetadataElement {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public class MethodOverrides {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.lang.reflect.Method;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@@ -94,7 +95,7 @@ public class ReplaceOverride extends MethodOverride {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (!(other instanceof ReplaceOverride) || !super.equals(other)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof RootBeanDefinition && super.equals(other)));
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.beans.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -154,7 +155,7 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user