Annotate Object#equals parameter with @Nullable
Closes gh-23093
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
@@ -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())));
|
||||
}
|
||||
|
||||
@@ -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())));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ public class MBeanClientInterceptor
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ public class NotificationListenerHolder {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ public class CronSequenceGenerator {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user