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

@@ -720,7 +720,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -519,7 +519,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -93,7 +93,7 @@ public class AspectJPointcutAdvisor implements PointcutAdvisor, Ordered {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -592,7 +592,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof MethodCacheKey &&
this.method == ((MethodCacheKey) other).method));
}

View File

@@ -349,7 +349,7 @@ class CglibAopProxy implements AopProxy, Serializable {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof CglibAopProxy &&
AopProxyUtils.equalsInProxy(this.advised, ((CglibAopProxy) other).advised)));
}
@@ -703,7 +703,7 @@ class CglibAopProxy implements AopProxy, Serializable {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other ||
(other instanceof DynamicAdvisedInterceptor &&
this.advised.equals(((DynamicAdvisedInterceptor) other).advised)));
@@ -899,7 +899,7 @@ class CglibAopProxy implements AopProxy, Serializable {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -65,7 +65,7 @@ public abstract class AbstractPointcutAdvisor implements PointcutAdvisor, Ordere
@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.Serializable;
import java.lang.reflect.Method;
import java.util.Arrays;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ObjectUtils;
@@ -195,7 +196,7 @@ public abstract class AbstractRegexpMethodPointcut extends StaticMethodMatcherPo
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -19,6 +19,7 @@ package org.springframework.aop.support;
import java.io.Serializable;
import org.springframework.aop.ClassFilter;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
@@ -106,7 +107,7 @@ public abstract class ClassFilters {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof UnionClassFilter &&
ObjectUtils.nullSafeEquals(this.filters, ((UnionClassFilter) other).filters)));
}
@@ -141,7 +142,7 @@ public abstract class ClassFilters {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof IntersectionClassFilter &&
ObjectUtils.nullSafeEquals(this.filters, ((IntersectionClassFilter) other).filters)));
}

View File

@@ -21,6 +21,7 @@ import java.io.Serializable;
import org.springframework.aop.ClassFilter;
import org.springframework.aop.MethodMatcher;
import org.springframework.aop.Pointcut;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -180,7 +181,7 @@ public class ComposablePointcut implements Pointcut, Serializable {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -123,7 +123,7 @@ public class ControlFlowPointcut implements Pointcut, ClassFilter, MethodMatcher
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -150,7 +150,7 @@ public class DefaultIntroductionAdvisor implements IntroductionAdvisor, ClassFil
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -22,6 +22,7 @@ import java.lang.reflect.Method;
import org.springframework.aop.ClassFilter;
import org.springframework.aop.IntroductionAwareMethodMatcher;
import org.springframework.aop.MethodMatcher;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -140,7 +141,7 @@ public abstract class MethodMatchers {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
@@ -207,7 +208,7 @@ public abstract class MethodMatchers {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
@@ -296,7 +297,7 @@ public abstract class MethodMatchers {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -22,6 +22,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.springframework.lang.Nullable;
import org.springframework.util.PatternMatchUtils;
/**
@@ -98,7 +99,7 @@ public class NameMatchMethodPointcut extends StaticMethodMatcherPointcut impleme
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof NameMatchMethodPointcut &&
this.mappedNames.equals(((NameMatchMethodPointcut) other).mappedNames)));
}

View File

@@ -20,6 +20,7 @@ import java.lang.annotation.Annotation;
import org.springframework.aop.ClassFilter;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -67,7 +68,7 @@ public class AnnotationClassFilter implements ClassFilter {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -120,7 +120,7 @@ public class AnnotationMatchingPointcut implements Pointcut {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -23,6 +23,7 @@ import java.lang.reflect.Proxy;
import org.springframework.aop.support.AopUtils;
import org.springframework.aop.support.StaticMethodMatcher;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -86,7 +87,7 @@ public class AnnotationMethodMatcher extends StaticMethodMatcher {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -114,7 +114,7 @@ public class MethodOverrides {
@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.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;
}

View File

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

View File

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

View File

@@ -48,7 +48,7 @@ public abstract class JCacheOperationSourcePointcut extends StaticMethodMatcherP
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -222,7 +222,7 @@ public class SimpleMailMessage implements MailMessage, Serializable {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -164,7 +164,7 @@ public class AnnotationCacheOperationSource extends AbstractFallbackCacheOperati
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -222,7 +222,7 @@ public class SpringCacheAnnotationParser implements CacheAnnotationParser, Seria
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || other instanceof SpringCacheAnnotationParser);
}

View File

@@ -836,7 +836,7 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
}
@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.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -100,7 +101,7 @@ public abstract class CacheOperation implements BasicOperation {
* @see #toString()
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (other instanceof CacheOperation && toString().equals(other.toString()));
}

View File

@@ -49,7 +49,7 @@ abstract class CacheOperationSourcePointcut extends StaticMethodMatcherPointcut
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -110,7 +110,7 @@ public class NameMatchCacheOperationSource implements CacheOperationSource, Seri
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -19,6 +19,7 @@ package org.springframework.cache.interceptor;
import java.io.Serializable;
import java.util.Arrays;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
@@ -54,7 +55,7 @@ public class SimpleKey implements Serializable {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other ||
(other instanceof SimpleKey && Arrays.deepEquals(this.params, ((SimpleKey) other).params)));
}

View File

@@ -223,7 +223,7 @@ final class ConfigurationClass {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof ConfigurationClass &&
getMetadata().getClassName().equals(((ConfigurationClass) other).getMetadata().getClassName())));
}

View File

@@ -1077,7 +1077,7 @@ class ConfigurationClassParser {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof SourceClass &&
this.metadata.getClassName().equals(((SourceClass) other).metadata.getClassName())));
}

View File

@@ -100,7 +100,7 @@ public interface DeferredImportSelector extends ImportSelector {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -322,10 +322,13 @@ public abstract class AbstractApplicationEventMulticaster
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof ListenerCacheKey)) {
return false;
}
ListenerCacheKey otherKey = (ListenerCacheKey) other;
return (this.eventType.equals(otherKey.eventType) &&
ObjectUtils.nullSafeEquals(this.sourceType, otherKey.sourceType));

View File

@@ -51,7 +51,7 @@ public final class AnnotatedElementKey implements Comparable<AnnotatedElementKey
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -22,6 +22,7 @@ import org.springframework.core.DefaultParameterNameDiscoverer;
import org.springframework.core.ParameterNameDiscoverer;
import org.springframework.expression.Expression;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
@@ -113,7 +114,7 @@ public abstract class CachedExpressionEvaluator {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -27,6 +27,7 @@ import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcess
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ApplicationEventMulticaster;
import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils;
/**
@@ -110,7 +111,7 @@ class ApplicationListenerDetector implements DestructionAwareBeanPostProcessor,
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof ApplicationListenerDetector &&
this.applicationContext == ((ApplicationListenerDetector) other).applicationContext));
}

View File

@@ -170,7 +170,7 @@ public class DefaultMessageSourceResolvable implements MessageSourceResolvable,
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -349,10 +349,13 @@ public class FormattingConversionService extends GenericConversionService
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
if (!(other instanceof AnnotationConverterKey)) {
return false;
}
AnnotationConverterKey otherKey = (AnnotationConverterKey) other;
return (this.fieldType == otherKey.fieldType && this.annotation.equals(otherKey.annotation));
}

View File

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

View File

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

View File

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

View File

@@ -19,6 +19,7 @@ package org.springframework.scheduling.support;
import java.util.Date;
import java.util.TimeZone;
import org.springframework.lang.Nullable;
import org.springframework.scheduling.Trigger;
import org.springframework.scheduling.TriggerContext;
@@ -89,7 +90,7 @@ public class CronTrigger implements Trigger {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof CronTrigger &&
this.sequenceGenerator.equals(((CronTrigger) other).sequenceGenerator)));
}

View File

@@ -144,7 +144,7 @@ public class PeriodicTrigger implements Trigger {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -360,7 +360,7 @@ public abstract class AbstractBindingResult extends AbstractErrors implements Bi
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -299,7 +299,7 @@ public class BindException extends Exception implements BindingResult {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || this.bindingResult.equals(other));
}

View File

@@ -92,7 +92,7 @@ public abstract class AttributeAccessorSupport implements AttributeAccessor, Ser
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof AttributeAccessorSupport &&
this.attributes.equals(((AttributeAccessorSupport) other).attributes)));
}

View File

@@ -50,7 +50,7 @@ public final class MethodClassKey implements Comparable<MethodClassKey> {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

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

View File

@@ -20,6 +20,7 @@ package org.springframework.core;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -66,7 +67,7 @@ public abstract class ParameterizedTypeReference<T> {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof ParameterizedTypeReference &&
this.type.equals(((ParameterizedTypeReference<?>) other).type)));
}

View File

@@ -880,7 +880,7 @@ public class ResolvableType implements Serializable {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
@@ -1549,7 +1549,7 @@ public class ResolvableType implements Serializable {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

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

View File

@@ -452,7 +452,7 @@ public class TypeDescriptor implements Serializable {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}
@@ -778,7 +778,7 @@ public class TypeDescriptor implements Serializable {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof AnnotatedElementAdapter &&
Arrays.equals(this.annotations, ((AnnotatedElementAdapter) other).annotations)));
}

View File

@@ -458,7 +458,7 @@ public class GenericConversionService implements ConfigurableConversionService {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -132,7 +132,7 @@ public abstract class PropertySource<T> {
* <p>No properties other than {@code name} are evaluated.
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof PropertySource &&
ObjectUtils.nullSafeEquals(this.name, ((PropertySource<?>) other).name)));
}

View File

@@ -215,7 +215,7 @@ public abstract class AbstractResource implements Resource {
* @see #getDescription()
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof Resource &&
((Resource) other).getDescription().equals(getDescription())));
}

View File

@@ -115,7 +115,7 @@ public class ByteArrayResource extends AbstractResource {
* @see java.util.Arrays#equals(byte[], byte[])
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof ByteArrayResource &&
Arrays.equals(((ByteArrayResource) other).byteArray, this.byteArray)));
}

View File

@@ -244,7 +244,7 @@ public class ClassPathResource extends AbstractFileResolvingResource {
* This implementation compares the underlying class path locations.
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -72,7 +72,7 @@ public class DescriptiveResource extends AbstractResource {
* This implementation compares the underlying description String.
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof DescriptiveResource &&
((DescriptiveResource) other).description.equals(this.description)));
}

View File

@@ -335,7 +335,7 @@ public class FileSystemResource extends AbstractResource implements WritableReso
* This implementation compares the underlying File references.
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof FileSystemResource &&
this.path.equals(((FileSystemResource) other).path)));
}

View File

@@ -115,7 +115,7 @@ public class InputStreamResource extends AbstractResource {
* This implementation compares the underlying InputStream.
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof InputStreamResource &&
((InputStreamResource) other).inputStream.equals(this.inputStream)));
}

View File

@@ -32,6 +32,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -275,7 +276,7 @@ public class PathResource extends AbstractResource implements WritableResource {
* This implementation compares the underlying Path references.
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof PathResource &&
this.path.equals(((PathResource) other).path)));
}

View File

@@ -263,7 +263,7 @@ public class UrlResource extends AbstractFileResolvingResource {
* This implementation compares the underlying URL references.
*/
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof UrlResource &&
this.cleanedUrl.equals(((UrlResource) other).cleanedUrl)));
}

View File

@@ -23,6 +23,7 @@ import java.net.URI;
import java.net.URL;
import org.springframework.core.NestedIOException;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -130,7 +131,7 @@ public class VfsResource extends AbstractResource {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof VfsResource &&
this.resource.equals(((VfsResource) other).resource)));
}

View File

@@ -24,6 +24,7 @@ import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.function.IntPredicate;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
@@ -411,7 +412,7 @@ public class DefaultDataBuffer implements DataBuffer {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -28,6 +28,7 @@ import io.netty.buffer.ByteBufInputStream;
import io.netty.buffer.ByteBufOutputStream;
import io.netty.buffer.ByteBufUtil;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
@@ -309,7 +310,7 @@ public class NettyDataBuffer implements PooledDataBuffer {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof NettyDataBuffer &&
this.byteBuf.equals(((NettyDataBuffer) other).byteBuf)));
}

View File

@@ -161,7 +161,7 @@ public class EncodedResource implements InputStreamSource {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -189,7 +189,7 @@ final class SimpleAnnotationMetadataReadingVisitor extends ClassVisitor {
}
@Override
public boolean equals(Object obj) {
public boolean equals(@Nullable Object obj) {
if (this == obj) {
return true;
}

View File

@@ -127,7 +127,7 @@ final class SimpleMethodMetadataReadingVisitor extends MethodVisitor {
}
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -25,6 +25,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.springframework.lang.Nullable;
/**
* Simple {@link List} wrapper class that allows for elements to be
* automatically populated as they are requested. This is particularly
@@ -231,7 +233,7 @@ public class AutoPopulatingList<E> implements List<E>, Serializable {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return this.backingList.equals(other);
}

View File

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

View File

@@ -758,7 +758,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
@Override
@SuppressWarnings("rawtypes")
public final boolean equals(Object other) {
public final boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -273,7 +273,7 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
}
@Override
public boolean equals(Object obj) {
public boolean equals(@Nullable Object obj) {
return this.targetMap.equals(obj);
}

View File

@@ -225,7 +225,7 @@ public class LinkedMultiValueMap<K, V> implements MultiValueMap<K, V>, Serializa
}
@Override
public boolean equals(Object obj) {
public boolean equals(@Nullable Object obj) {
return this.targetMap.equals(obj);
}

View File

@@ -420,7 +420,7 @@ public class MimeType implements Comparable<MimeType>, Serializable {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

View File

@@ -19,6 +19,8 @@ package org.springframework.util.comparator;
import java.io.Serializable;
import java.util.Comparator;
import org.springframework.lang.Nullable;
/**
* A {@link Comparator} for {@link Boolean} objects that can sort either
* {@code true} or {@code false} first.
@@ -67,7 +69,7 @@ public class BooleanComparator implements Comparator<Boolean>, Serializable {
@Override
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof BooleanComparator &&
this.trueLow == ((BooleanComparator) other).trueLow));
}

View File

@@ -21,6 +21,7 @@ import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -187,7 +188,7 @@ public class CompoundComparator<T> implements Comparator<T>, Serializable {
@Override
@SuppressWarnings("unchecked")
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
return (this == other || (other instanceof CompoundComparator &&
this.comparators.equals(((CompoundComparator<T>) other).comparators)));
}

View File

@@ -19,6 +19,7 @@ package org.springframework.util.comparator;
import java.io.Serializable;
import java.util.Comparator;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
@@ -108,7 +109,7 @@ public class InvertibleComparator<T> implements Comparator<T>, Serializable {
@Override
@SuppressWarnings("unchecked")
public boolean equals(Object other) {
public boolean equals(@Nullable Object other) {
if (this == other) {
return true;
}

Some files were not shown because too many files have changed in this diff Show More