Consistent equals/hashCode style (and related polishing)
This commit is contained in:
parent
bbcc788f60
commit
2f33e77ab4
|
@ -714,13 +714,8 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AdviceExcludingMethodMatcher otherMm)) {
|
||||
return false;
|
||||
}
|
||||
return this.adviceMethod.equals(otherMm.adviceMethod);
|
||||
return (this == other || (other instanceof AdviceExcludingMethodMatcher that &&
|
||||
this.adviceMethod.equals(that.adviceMethod)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -243,8 +243,8 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
|
||||
/**
|
||||
* If a pointcut expression has been specified in XML, the user cannot
|
||||
* write {@code and} as "&&" (though && will work).
|
||||
* We also allow {@code and} between two pointcut sub-expressions.
|
||||
* write "and" as "&&" (though {@code &&} will work).
|
||||
* <p>We also allow "and" between two pointcut sub-expressions.
|
||||
* <p>This method converts back to {@code &&} for the AspectJ pointcut parser.
|
||||
*/
|
||||
private String replaceBooleanOperators(String pcExpr) {
|
||||
|
@ -516,21 +516,16 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AspectJExpressionPointcut otherPc)) {
|
||||
return false;
|
||||
}
|
||||
return ObjectUtils.nullSafeEquals(this.getExpression(), otherPc.getExpression()) &&
|
||||
ObjectUtils.nullSafeEquals(this.pointcutDeclarationScope, otherPc.pointcutDeclarationScope) &&
|
||||
ObjectUtils.nullSafeEquals(this.pointcutParameterNames, otherPc.pointcutParameterNames) &&
|
||||
ObjectUtils.nullSafeEquals(this.pointcutParameterTypes, otherPc.pointcutParameterTypes);
|
||||
return (this == other || (other instanceof AspectJExpressionPointcut that &&
|
||||
ObjectUtils.nullSafeEquals(getExpression(), that.getExpression()) &&
|
||||
ObjectUtils.nullSafeEquals(this.pointcutDeclarationScope, that.pointcutDeclarationScope) &&
|
||||
ObjectUtils.nullSafeEquals(this.pointcutParameterNames, that.pointcutParameterNames) &&
|
||||
ObjectUtils.nullSafeEquals(this.pointcutParameterTypes, that.pointcutParameterTypes)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hashCode = ObjectUtils.nullSafeHashCode(this.getExpression());
|
||||
int hashCode = ObjectUtils.nullSafeHashCode(getExpression());
|
||||
hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutDeclarationScope);
|
||||
hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutParameterNames);
|
||||
hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutParameterTypes);
|
||||
|
|
|
@ -89,13 +89,8 @@ public class AspectJPointcutAdvisor implements PointcutAdvisor, Ordered {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AspectJPointcutAdvisor otherAdvisor)) {
|
||||
return false;
|
||||
}
|
||||
return this.advice.equals(otherAdvisor.advice);
|
||||
return (this == other || (other instanceof AspectJPointcutAdvisor that &&
|
||||
this.advice.equals(that.advice)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -597,15 +597,10 @@ class CglibAopProxy implements AopProxy, Serializable {
|
|||
}
|
||||
if (other instanceof Factory factory) {
|
||||
Callback callback = factory.getCallback(INVOKE_EQUALS);
|
||||
if (!(callback instanceof EqualsInterceptor equalsInterceptor)) {
|
||||
return false;
|
||||
}
|
||||
AdvisedSupport otherAdvised = equalsInterceptor.advised;
|
||||
return AopProxyUtils.equalsInProxy(this.advised, otherAdvised);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
return (callback instanceof EqualsInterceptor that &&
|
||||
AopProxyUtils.equalsInProxy(this.advised, that.advised));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -920,20 +915,14 @@ class CglibAopProxy implements AopProxy, Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ProxyCallbackFilter otherCallbackFilter)) {
|
||||
return false;
|
||||
}
|
||||
AdvisedSupport otherAdvised = otherCallbackFilter.advised;
|
||||
return (this.advised.getAdvisorKey().equals(otherAdvised.getAdvisorKey()) &&
|
||||
AopProxyUtils.equalsProxiedInterfaces(this.advised, otherAdvised) &&
|
||||
ObjectUtils.nullSafeEquals(this.advised.getTargetClass(), otherAdvised.getTargetClass()) &&
|
||||
this.advised.getTargetSource().isStatic() == otherAdvised.getTargetSource().isStatic() &&
|
||||
this.advised.isFrozen() == otherAdvised.isFrozen() &&
|
||||
this.advised.isExposeProxy() == otherAdvised.isExposeProxy() &&
|
||||
this.advised.isOpaque() == otherAdvised.isOpaque());
|
||||
return (this == other || (other instanceof ProxyCallbackFilter that &&
|
||||
this.advised.getAdvisorKey().equals(that.advised.getAdvisorKey()) &&
|
||||
AopProxyUtils.equalsProxiedInterfaces(this.advised, that.advised) &&
|
||||
ObjectUtils.nullSafeEquals(this.advised.getTargetClass(), that.advised.getTargetClass()) &&
|
||||
this.advised.getTargetSource().isStatic() == that.advised.getTargetSource().isStatic() &&
|
||||
this.advised.isFrozen() == that.advised.isFrozen() &&
|
||||
this.advised.isExposeProxy() == that.advised.isExposeProxy() &&
|
||||
this.advised.isOpaque() == that.advised.isOpaque()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -133,13 +133,9 @@ public final class EmptyTargetSource implements TargetSource, Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof EmptyTargetSource otherTs)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.targetClass, otherTs.targetClass) && this.isStatic == otherTs.isStatic);
|
||||
return (this == other || (other instanceof EmptyTargetSource that &&
|
||||
ObjectUtils.nullSafeEquals(this.targetClass, that.targetClass) &&
|
||||
this.isStatic == that.isStatic));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -82,15 +82,10 @@ public class BeanMetadataAttribute implements BeanMetadataElement {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof BeanMetadataAttribute otherMa)) {
|
||||
return false;
|
||||
}
|
||||
return (this.name.equals(otherMa.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.value, otherMa.value) &&
|
||||
ObjectUtils.nullSafeEquals(this.source, otherMa.source));
|
||||
return (this == other ||(other instanceof BeanMetadataAttribute that &&
|
||||
this.name.equals(that.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.value, that.value) &&
|
||||
ObjectUtils.nullSafeEquals(this.source, that.source)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -491,16 +491,11 @@ class ExtendedBeanInfo implements BeanInfo {
|
|||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof IndexedPropertyDescriptor otherPd)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(getIndexedReadMethod(), otherPd.getIndexedReadMethod()) &&
|
||||
ObjectUtils.nullSafeEquals(getIndexedWriteMethod(), otherPd.getIndexedWriteMethod()) &&
|
||||
ObjectUtils.nullSafeEquals(getIndexedPropertyType(), otherPd.getIndexedPropertyType()) &&
|
||||
PropertyDescriptorUtils.equals(this, otherPd));
|
||||
return (this == other || (other instanceof IndexedPropertyDescriptor that &&
|
||||
ObjectUtils.nullSafeEquals(getIndexedReadMethod(), that.getIndexedReadMethod()) &&
|
||||
ObjectUtils.nullSafeEquals(getIndexedWriteMethod(), that.getIndexedWriteMethod()) &&
|
||||
ObjectUtils.nullSafeEquals(getIndexedPropertyType(), that.getIndexedPropertyType()) &&
|
||||
PropertyDescriptorUtils.equals(this, that)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -165,13 +165,9 @@ final class GenericTypeAwarePropertyDescriptor extends PropertyDescriptor {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof GenericTypeAwarePropertyDescriptor otherPd)) {
|
||||
return false;
|
||||
}
|
||||
return (getBeanClass().equals(otherPd.getBeanClass()) && PropertyDescriptorUtils.equals(this, otherPd));
|
||||
return (this == other || (other instanceof GenericTypeAwarePropertyDescriptor that &&
|
||||
getBeanClass().equals(that.getBeanClass()) &&
|
||||
PropertyDescriptorUtils.equals(this, that)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -189,15 +189,10 @@ public class PropertyValue extends BeanMetadataAttributeAccessor implements Seri
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof PropertyValue otherPv)) {
|
||||
return false;
|
||||
}
|
||||
return (this.name.equals(otherPv.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.value, otherPv.value) &&
|
||||
ObjectUtils.nullSafeEquals(getSource(), otherPv.getSource()));
|
||||
return (this == other || (other instanceof PropertyValue that &&
|
||||
this.name.equals(that.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.value, that.value) &&
|
||||
ObjectUtils.nullSafeEquals(getSource(), that.getSource())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -340,13 +340,8 @@ public class InjectionMetadata {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof InjectedElement otherElement)) {
|
||||
return false;
|
||||
}
|
||||
return this.member.equals(otherElement.member);
|
||||
return (this == other || (other instanceof InjectedElement that &&
|
||||
this.member.equals(that.member)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -165,15 +165,10 @@ public class BeanDefinitionHolder implements BeanMetadataElement {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof BeanDefinitionHolder otherHolder)) {
|
||||
return false;
|
||||
}
|
||||
return this.beanDefinition.equals(otherHolder.beanDefinition) &&
|
||||
this.beanName.equals(otherHolder.beanName) &&
|
||||
ObjectUtils.nullSafeEquals(this.aliases, otherHolder.aliases);
|
||||
return (this == other || (other instanceof BeanDefinitionHolder that &&
|
||||
this.beanDefinition.equals(that.beanDefinition) &&
|
||||
this.beanName.equals(that.beanName) &&
|
||||
ObjectUtils.nullSafeEquals(this.aliases, that.aliases)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -70,13 +70,8 @@ public class BeanExpressionContext {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof BeanExpressionContext otherContext)) {
|
||||
return false;
|
||||
}
|
||||
return (this.beanFactory == otherContext.beanFactory && this.scope == otherContext.scope);
|
||||
return (this == other || (other instanceof BeanExpressionContext that &&
|
||||
this.beanFactory == that.beanFactory && this.scope == that.scope));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -68,13 +68,8 @@ public class RuntimeBeanNameReference implements BeanReference {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof RuntimeBeanNameReference that)) {
|
||||
return false;
|
||||
}
|
||||
return this.beanName.equals(that.beanName);
|
||||
return (this == other || (other instanceof RuntimeBeanNameReference that &&
|
||||
this.beanName.equals(that.beanName)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -132,14 +132,9 @@ public class RuntimeBeanReference implements BeanReference {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof RuntimeBeanReference that)) {
|
||||
return false;
|
||||
}
|
||||
return (this.beanName.equals(that.beanName) && this.beanType == that.beanType &&
|
||||
this.toParent == that.toParent);
|
||||
return (this == other || (other instanceof RuntimeBeanReference that &&
|
||||
this.beanName.equals(that.beanName) && this.beanType == that.beanType &&
|
||||
this.toParent == that.toParent));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -216,14 +216,9 @@ public class TypedStringValue implements BeanMetadataElement {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof TypedStringValue otherValue)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.value, otherValue.value) &&
|
||||
ObjectUtils.nullSafeEquals(this.targetType, otherValue.targetType));
|
||||
return (this == other || (other instanceof TypedStringValue that &&
|
||||
ObjectUtils.nullSafeEquals(this.value, that.value) &&
|
||||
ObjectUtils.nullSafeEquals(this.targetType, that.targetType)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1211,13 +1211,8 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AbstractBeanDefinition that)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName()) &&
|
||||
return (this == other || (other instanceof AbstractBeanDefinition that &&
|
||||
ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName()) &&
|
||||
ObjectUtils.nullSafeEquals(this.scope, that.scope) &&
|
||||
this.abstractFlag == that.abstractFlag &&
|
||||
this.lazyInit == that.lazyInit &&
|
||||
|
@ -1240,7 +1235,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
|
|||
this.enforceDestroyMethod == that.enforceDestroyMethod &&
|
||||
this.synthetic == that.synthetic &&
|
||||
this.role == that.role &&
|
||||
super.equals(other));
|
||||
super.equals(other)));
|
||||
}
|
||||
|
||||
private boolean equalsConstructorArgumentValues(AbstractBeanDefinition other) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -157,13 +157,8 @@ public class ChildBeanDefinition extends AbstractBeanDefinition {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ChildBeanDefinition that)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.parentName, that.parentName) && super.equals(other));
|
||||
return (this == other || (other instanceof ChildBeanDefinition that &&
|
||||
ObjectUtils.nullSafeEquals(this.parentName, that.parentName) && super.equals(other)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -87,13 +87,8 @@ public class GenericBeanDefinition extends AbstractBeanDefinition {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof GenericBeanDefinition that)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.parentName, that.parentName) && super.equals(other));
|
||||
return (this == other || (other instanceof GenericBeanDefinition that &&
|
||||
ObjectUtils.nullSafeEquals(this.parentName, that.parentName) && super.equals(other)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -102,16 +102,14 @@ public class LookupOverride extends MethodOverride {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (!(other instanceof LookupOverride that) || !super.equals(other)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.method, that.method) &&
|
||||
return (other instanceof LookupOverride that && super.equals(other) &&
|
||||
ObjectUtils.nullSafeEquals(this.method, that.method) &&
|
||||
ObjectUtils.nullSafeEquals(this.beanName, that.beanName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (29 * super.hashCode() + ObjectUtils.nullSafeHashCode(this.beanName));
|
||||
return super.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.beanName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -106,14 +106,9 @@ public abstract class MethodOverride implements BeanMetadataElement {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof MethodOverride that)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.methodName, that.methodName) &&
|
||||
ObjectUtils.nullSafeEquals(this.source, that.source));
|
||||
return (this == other || (other instanceof MethodOverride that &&
|
||||
ObjectUtils.nullSafeEquals(this.methodName, that.methodName) &&
|
||||
ObjectUtils.nullSafeEquals(this.source, that.source)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -104,13 +104,8 @@ public class MethodOverrides {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof MethodOverrides that)) {
|
||||
return false;
|
||||
}
|
||||
return this.overrides.equals(that.overrides);
|
||||
return (this == other || (other instanceof MethodOverrides that &&
|
||||
this.overrides.equals(that.overrides)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -97,10 +97,8 @@ public class ReplaceOverride extends MethodOverride {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (!(other instanceof ReplaceOverride that) || !super.equals(other)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.methodReplacerBeanName, that.methodReplacerBeanName) &&
|
||||
return (other instanceof ReplaceOverride that && super.equals(other) &&
|
||||
ObjectUtils.nullSafeEquals(this.methodReplacerBeanName, that.methodReplacerBeanName) &&
|
||||
ObjectUtils.nullSafeEquals(this.typeIdentifiers, that.typeIdentifiers));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -156,15 +156,10 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof SortDefinition otherSd)) {
|
||||
return false;
|
||||
}
|
||||
return (getProperty().equals(otherSd.getProperty()) &&
|
||||
isAscending() == otherSd.isAscending() &&
|
||||
isIgnoreCase() == otherSd.isIgnoreCase());
|
||||
return (this == other || (other instanceof SortDefinition that &&
|
||||
getProperty().equals(that.getProperty()) &&
|
||||
isAscending() == that.isAscending() &&
|
||||
isIgnoreCase() == that.isIgnoreCase()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -65,10 +65,8 @@ public class SerializablePerson implements Person, Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (!(other instanceof SerializablePerson p)) {
|
||||
return false;
|
||||
}
|
||||
return p.age == age && ObjectUtils.nullSafeEquals(name, p.name);
|
||||
return (this == other || (other instanceof SerializablePerson that &&
|
||||
ObjectUtils.nullSafeEquals(this.name, that.name) && this.age == that.age));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -466,18 +466,13 @@ public class TestBean implements BeanNameAware, BeanFactoryAware, ITestBean, IOt
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof TestBean tb2)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.name, tb2.name) && this.age == tb2.age);
|
||||
return (this == other || (other instanceof TestBean that &&
|
||||
ObjectUtils.nullSafeEquals(this.name, that.name) && this.age == that.age));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.age;
|
||||
return TestBean.class.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -51,13 +51,8 @@ public abstract class JCacheOperationSourcePointcut extends StaticMethodMatcherP
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof JCacheOperationSourcePointcut otherPc)) {
|
||||
return false;
|
||||
}
|
||||
return ObjectUtils.nullSafeEquals(getCacheOperationSource(), otherPc.getCacheOperationSource());
|
||||
return (this == other || (other instanceof JCacheOperationSourcePointcut that &&
|
||||
ObjectUtils.nullSafeEquals(getCacheOperationSource(), that.getCacheOperationSource())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -223,20 +223,15 @@ public class SimpleMailMessage implements MailMessage, Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof SimpleMailMessage otherMessage)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.from, otherMessage.from) &&
|
||||
ObjectUtils.nullSafeEquals(this.replyTo, otherMessage.replyTo) &&
|
||||
ObjectUtils.nullSafeEquals(this.to, otherMessage.to) &&
|
||||
ObjectUtils.nullSafeEquals(this.cc, otherMessage.cc) &&
|
||||
ObjectUtils.nullSafeEquals(this.bcc, otherMessage.bcc) &&
|
||||
ObjectUtils.nullSafeEquals(this.sentDate, otherMessage.sentDate) &&
|
||||
ObjectUtils.nullSafeEquals(this.subject, otherMessage.subject) &&
|
||||
ObjectUtils.nullSafeEquals(this.text, otherMessage.text));
|
||||
return (this == other || (other instanceof SimpleMailMessage that &&
|
||||
ObjectUtils.nullSafeEquals(this.from, that.from) &&
|
||||
ObjectUtils.nullSafeEquals(this.replyTo, that.replyTo) &&
|
||||
ObjectUtils.nullSafeEquals(this.to, that.to) &&
|
||||
ObjectUtils.nullSafeEquals(this.cc, that.cc) &&
|
||||
ObjectUtils.nullSafeEquals(this.bcc, that.bcc) &&
|
||||
ObjectUtils.nullSafeEquals(this.sentDate, that.sentDate) &&
|
||||
ObjectUtils.nullSafeEquals(this.subject, that.subject) &&
|
||||
ObjectUtils.nullSafeEquals(this.text, that.text)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -853,14 +853,9 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof CacheOperationCacheKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.cacheOperation.equals(otherKey.cacheOperation) &&
|
||||
this.methodCacheKey.equals(otherKey.methodCacheKey));
|
||||
return (this == other || (other instanceof CacheOperationCacheKey that &&
|
||||
this.cacheOperation.equals(that.cacheOperation) &&
|
||||
this.methodCacheKey.equals(that.methodCacheKey)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -65,7 +65,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex
|
|||
* through {@link #register} calls and then manually {@linkplain #refresh refreshed}.
|
||||
*/
|
||||
public AnnotationConfigApplicationContext() {
|
||||
StartupStep createAnnotatedBeanDefReader = this.getApplicationStartup().start("spring.context.annotated-bean-reader.create");
|
||||
StartupStep createAnnotatedBeanDefReader = getApplicationStartup().start("spring.context.annotated-bean-reader.create");
|
||||
this.reader = new AnnotatedBeanDefinitionReader(this);
|
||||
createAnnotatedBeanDefReader.end();
|
||||
this.scanner = new ClassPathBeanDefinitionScanner(this);
|
||||
|
@ -163,7 +163,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex
|
|||
@Override
|
||||
public void register(Class<?>... componentClasses) {
|
||||
Assert.notEmpty(componentClasses, "At least one component class must be specified");
|
||||
StartupStep registerComponentClass = this.getApplicationStartup().start("spring.context.component-classes.register")
|
||||
StartupStep registerComponentClass = getApplicationStartup().start("spring.context.component-classes.register")
|
||||
.tag("classes", () -> Arrays.toString(componentClasses));
|
||||
this.reader.register(componentClasses);
|
||||
registerComponentClass.end();
|
||||
|
@ -180,7 +180,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex
|
|||
@Override
|
||||
public void scan(String... basePackages) {
|
||||
Assert.notEmpty(basePackages, "At least one base package must be specified");
|
||||
StartupStep scanPackages = this.getApplicationStartup().start("spring.context.base-packages.scan")
|
||||
StartupStep scanPackages = getApplicationStartup().start("spring.context.base-packages.scan")
|
||||
.tag("packages", () -> Arrays.toString(basePackages));
|
||||
this.scanner.scan(basePackages);
|
||||
scanPackages.end();
|
||||
|
|
|
@ -397,14 +397,9 @@ public abstract class AbstractApplicationEventMulticaster
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ListenerCacheKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.eventType.equals(otherKey.eventType) &&
|
||||
ObjectUtils.nullSafeEquals(this.sourceType, otherKey.sourceType));
|
||||
return (this == other || (other instanceof ListenerCacheKey that &&
|
||||
this.eventType.equals(that.eventType) &&
|
||||
ObjectUtils.nullSafeEquals(this.sourceType, that.sourceType)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -52,14 +52,9 @@ public final class AnnotatedElementKey implements Comparable<AnnotatedElementKey
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AnnotatedElementKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.element.equals(otherKey.element) &&
|
||||
ObjectUtils.nullSafeEquals(this.targetClass, otherKey.targetClass));
|
||||
return (this == other || (other instanceof AnnotatedElementKey that &&
|
||||
this.element.equals(that.element) &&
|
||||
ObjectUtils.nullSafeEquals(this.targetClass, that.targetClass)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -124,14 +124,9 @@ public abstract class CachedExpressionEvaluator {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ExpressionKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.element.equals(otherKey.element) &&
|
||||
ObjectUtils.nullSafeEquals(this.expression, otherKey.expression));
|
||||
return (this == other || (other instanceof ExpressionKey that &&
|
||||
this.element.equals(that.element) &&
|
||||
ObjectUtils.nullSafeEquals(this.expression, that.expression)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -84,7 +84,7 @@ public abstract class AbstractXmlApplicationContext extends AbstractRefreshableC
|
|||
|
||||
// Configure the bean definition reader with this context's
|
||||
// resource loading environment.
|
||||
beanDefinitionReader.setEnvironment(this.getEnvironment());
|
||||
beanDefinitionReader.setEnvironment(getEnvironment());
|
||||
beanDefinitionReader.setResourceLoader(this);
|
||||
beanDefinitionReader.setEntityResolver(new ResourceEntityResolver(this));
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -171,15 +171,10 @@ public class DefaultMessageSourceResolvable implements MessageSourceResolvable,
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof MessageSourceResolvable otherResolvable)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(getCodes(), otherResolvable.getCodes()) &&
|
||||
ObjectUtils.nullSafeEquals(getArguments(), otherResolvable.getArguments()) &&
|
||||
ObjectUtils.nullSafeEquals(getDefaultMessage(), otherResolvable.getDefaultMessage()));
|
||||
return (this == other || (other instanceof MessageSourceResolvable that &&
|
||||
ObjectUtils.nullSafeEquals(getCodes(), that.getCodes()) &&
|
||||
ObjectUtils.nullSafeEquals(getArguments(), that.getArguments()) &&
|
||||
ObjectUtils.nullSafeEquals(getDefaultMessage(), that.getDefaultMessage())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -367,13 +367,8 @@ public class FormattingConversionService extends GenericConversionService
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AnnotationConverterKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.fieldType == otherKey.fieldType && this.annotation.equals(otherKey.annotation));
|
||||
return (this == other || (other instanceof AnnotationConverterKey that &&
|
||||
this.fieldType == that.fieldType && this.annotation.equals(that.annotation)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -655,13 +655,9 @@ public class MBeanClientInterceptor
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof MethodCacheKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.name.equals(otherKey.name) && Arrays.equals(this.parameterTypes, otherKey.parameterTypes));
|
||||
return (this == other || (other instanceof MethodCacheKey that &&
|
||||
this.name.equals(that.name) &&
|
||||
Arrays.equals(this.parameterTypes, that.parameterTypes)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -158,16 +158,11 @@ public class NotificationListenerHolder {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof NotificationListenerHolder otherNlh)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.notificationListener, otherNlh.notificationListener) &&
|
||||
ObjectUtils.nullSafeEquals(this.notificationFilter, otherNlh.notificationFilter) &&
|
||||
ObjectUtils.nullSafeEquals(this.handback, otherNlh.handback) &&
|
||||
ObjectUtils.nullSafeEquals(this.mappedObjectNames, otherNlh.mappedObjectNames));
|
||||
return (this == other || (other instanceof NotificationListenerHolder that &&
|
||||
ObjectUtils.nullSafeEquals(this.notificationListener, that.notificationListener) &&
|
||||
ObjectUtils.nullSafeEquals(this.notificationFilter, that.notificationFilter) &&
|
||||
ObjectUtils.nullSafeEquals(this.handback, that.handback) &&
|
||||
ObjectUtils.nullSafeEquals(this.mappedObjectNames, that.mappedObjectNames)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -435,15 +435,10 @@ public class CronSequenceGenerator {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof CronSequenceGenerator otherCron)) {
|
||||
return false;
|
||||
}
|
||||
return (this.months.equals(otherCron.months) && this.daysOfMonth.equals(otherCron.daysOfMonth) &&
|
||||
this.daysOfWeek.equals(otherCron.daysOfWeek) && this.hours.equals(otherCron.hours) &&
|
||||
this.minutes.equals(otherCron.minutes) && this.seconds.equals(otherCron.seconds));
|
||||
return (this == other || (other instanceof CronSequenceGenerator that &&
|
||||
this.months.equals(that.months) && this.daysOfMonth.equals(that.daysOfMonth) &&
|
||||
this.daysOfWeek.equals(that.daysOfWeek) && this.hours.equals(that.hours) &&
|
||||
this.minutes.equals(that.minutes) && this.seconds.equals(that.seconds)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -247,15 +247,10 @@ public class PeriodicTrigger implements Trigger {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof PeriodicTrigger otherTrigger)) {
|
||||
return false;
|
||||
}
|
||||
return (this.fixedRate == otherTrigger.fixedRate &&
|
||||
this.period.equals(otherTrigger.period) &&
|
||||
Objects.equals(this.initialDelay, otherTrigger.initialDelay));
|
||||
return (this == other || (other instanceof PeriodicTrigger that &&
|
||||
this.fixedRate == that.fixedRate &&
|
||||
this.period.equals(that.period) &&
|
||||
Objects.equals(this.initialDelay, that.initialDelay)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -358,15 +358,10 @@ public abstract class AbstractBindingResult extends AbstractErrors implements Bi
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof BindingResult otherResult)) {
|
||||
return false;
|
||||
}
|
||||
return (getObjectName().equals(otherResult.getObjectName()) &&
|
||||
ObjectUtils.nullSafeEquals(getTarget(), otherResult.getTarget()) &&
|
||||
getAllErrors().equals(otherResult.getAllErrors()));
|
||||
return (this == other || (other instanceof BindingResult that &&
|
||||
getObjectName().equals(that.getObjectName()) &&
|
||||
ObjectUtils.nullSafeEquals(getTarget(), that.getTarget()) &&
|
||||
getAllErrors().equals(that.getAllErrors())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,12 +37,14 @@ public abstract class AbstractTypeReference implements TypeReference {
|
|||
@Nullable
|
||||
private final TypeReference enclosingType;
|
||||
|
||||
|
||||
protected AbstractTypeReference(String packageName, String simpleName, @Nullable TypeReference enclosingType) {
|
||||
this.packageName = packageName;
|
||||
this.simpleName = simpleName;
|
||||
this.enclosingType = enclosingType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
TypeReference enclosingType = getEnclosingType();
|
||||
|
@ -67,32 +69,28 @@ public abstract class AbstractTypeReference implements TypeReference {
|
|||
return this.enclosingType;
|
||||
}
|
||||
|
||||
protected abstract boolean isPrimitive();
|
||||
|
||||
protected String addPackageIfNecessary(String part) {
|
||||
if (this.packageName.isEmpty() ||
|
||||
this.packageName.equals("java.lang") && isPrimitive()) {
|
||||
(this.packageName.equals("java.lang") && isPrimitive())) {
|
||||
return part;
|
||||
}
|
||||
return this.packageName + '.' + part;
|
||||
}
|
||||
|
||||
protected abstract boolean isPrimitive();
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof TypeReference that &&
|
||||
getCanonicalName().equals(that.getCanonicalName())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getCanonicalName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof TypeReference otherReference)) {
|
||||
return false;
|
||||
}
|
||||
return getCanonicalName().equals(otherReference.getCanonicalName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getCanonicalName();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -51,14 +51,9 @@ public final class MethodClassKey implements Comparable<MethodClassKey> {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof MethodClassKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.method.equals(otherKey.method) &&
|
||||
ObjectUtils.nullSafeEquals(this.targetClass, otherKey.targetClass));
|
||||
return (this == other || (other instanceof MethodClassKey that &&
|
||||
this.method.equals(that.method) &&
|
||||
ObjectUtils.nullSafeEquals(this.targetClass, that.targetClass)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -750,17 +750,12 @@ public class MethodParameter {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof MethodParameter otherParam)) {
|
||||
return false;
|
||||
}
|
||||
return (getContainingClass() == otherParam.getContainingClass() &&
|
||||
ObjectUtils.nullSafeEquals(this.typeIndexesPerLevel, otherParam.typeIndexesPerLevel) &&
|
||||
this.nestingLevel == otherParam.nestingLevel &&
|
||||
this.parameterIndex == otherParam.parameterIndex &&
|
||||
this.executable.equals(otherParam.executable));
|
||||
return (this == other || (other instanceof MethodParameter that &&
|
||||
getContainingClass() == that.getContainingClass() &&
|
||||
ObjectUtils.nullSafeEquals(this.typeIndexesPerLevel, that.typeIndexesPerLevel) &&
|
||||
this.nestingLevel == that.nestingLevel &&
|
||||
this.parameterIndex == that.parameterIndex &&
|
||||
this.executable.equals(that.executable)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1577,14 +1577,9 @@ public class ResolvableType implements Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ParameterizedType otherType)) {
|
||||
return false;
|
||||
}
|
||||
return (otherType.getOwnerType() == null && this.rawType.equals(otherType.getRawType()) &&
|
||||
Arrays.equals(this.typeArguments, otherType.getActualTypeArguments()));
|
||||
return (this == other || (other instanceof ParameterizedType that &&
|
||||
that.getOwnerType() == null && this.rawType.equals(that.getRawType()) &&
|
||||
Arrays.equals(this.typeArguments, that.getActualTypeArguments())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -260,16 +260,11 @@ public final class Property {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof Property otherProperty)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.objectType, otherProperty.objectType) &&
|
||||
ObjectUtils.nullSafeEquals(this.name, otherProperty.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.readMethod, otherProperty.readMethod) &&
|
||||
ObjectUtils.nullSafeEquals(this.writeMethod, otherProperty.writeMethod));
|
||||
return (this == other || (other instanceof Property that &&
|
||||
ObjectUtils.nullSafeEquals(this.objectType, that.objectType) &&
|
||||
ObjectUtils.nullSafeEquals(this.name, that.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.readMethod, that.readMethod) &&
|
||||
ObjectUtils.nullSafeEquals(this.writeMethod, that.writeMethod)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -387,7 +387,7 @@ public class GenericConversionService implements ConfigurableConversionService {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (this.typeInfo + " : " + this.converter);
|
||||
return this.typeInfo + " : " + this.converter;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -438,7 +438,7 @@ public class GenericConversionService implements ConfigurableConversionService {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (this.typeInfo + " : " + this.converterFactory);
|
||||
return this.typeInfo + " : " + this.converterFactory;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -459,25 +459,19 @@ public class GenericConversionService implements ConfigurableConversionService {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ConverterCacheKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.sourceType.equals(otherKey.sourceType)) &&
|
||||
this.targetType.equals(otherKey.targetType);
|
||||
return (this == other || (other instanceof ConverterCacheKey that &&
|
||||
this.sourceType.equals(that.sourceType)) &&
|
||||
this.targetType.equals(that.targetType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (this.sourceType.hashCode() * 29 + this.targetType.hashCode());
|
||||
return this.sourceType.hashCode() * 29 + this.targetType.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ("ConverterCacheKey [sourceType = " + this.sourceType +
|
||||
", targetType = " + this.targetType + "]");
|
||||
return "ConverterCacheKey [sourceType = " + this.sourceType + ", targetType = " + this.targetType + "]";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -252,7 +252,7 @@ public abstract class CommandLinePropertySource<T> extends EnumerablePropertySou
|
|||
@Override
|
||||
public final boolean containsProperty(String name) {
|
||||
if (this.nonOptionArgsPropertyName.equals(name)) {
|
||||
return !this.getNonOptionArgs().isEmpty();
|
||||
return !getNonOptionArgs().isEmpty();
|
||||
}
|
||||
return this.containsOption(name);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ public abstract class CommandLinePropertySource<T> extends EnumerablePropertySou
|
|||
@Nullable
|
||||
public final String getProperty(String name) {
|
||||
if (this.nonOptionArgsPropertyName.equals(name)) {
|
||||
Collection<String> nonOptionArguments = this.getNonOptionArgs();
|
||||
Collection<String> nonOptionArguments = getNonOptionArgs();
|
||||
if (nonOptionArguments.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ public abstract class CommandLinePropertySource<T> extends EnumerablePropertySou
|
|||
return StringUtils.collectionToCommaDelimitedString(nonOptionArguments);
|
||||
}
|
||||
}
|
||||
Collection<String> optionValues = this.getOptionValues(name);
|
||||
Collection<String> optionValues = getOptionValues(name);
|
||||
if (optionValues == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -482,15 +482,10 @@ public class DefaultDataBuffer implements DataBuffer {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof DefaultDataBuffer otherBuffer)) {
|
||||
return false;
|
||||
}
|
||||
return (this.readPosition == otherBuffer.readPosition &&
|
||||
this.writePosition == otherBuffer.writePosition &&
|
||||
this.byteBuffer.equals(otherBuffer.byteBuffer));
|
||||
return (this == other || (other instanceof DefaultDataBuffer that &&
|
||||
this.readPosition == that.readPosition &&
|
||||
this.writePosition == that.writePosition &&
|
||||
this.byteBuffer.equals(that.byteBuffer)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -184,15 +184,10 @@ public class EncodedResource implements InputStreamSource {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof EncodedResource otherResource)) {
|
||||
return false;
|
||||
}
|
||||
return (this.resource.equals(otherResource.resource) &&
|
||||
ObjectUtils.nullSafeEquals(this.charset, otherResource.charset) &&
|
||||
ObjectUtils.nullSafeEquals(this.encoding, otherResource.encoding));
|
||||
return (this == other || (other instanceof EncodedResource that &&
|
||||
this.resource.equals(that.resource) &&
|
||||
ObjectUtils.nullSafeEquals(this.charset, that.charset) &&
|
||||
ObjectUtils.nullSafeEquals(this.encoding, that.encoding)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -751,28 +751,22 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
|
|||
return previous;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof Map.Entry<?, ?> that &&
|
||||
ObjectUtils.nullSafeEquals(getKey(), that.getKey()) &&
|
||||
ObjectUtils.nullSafeEquals(getValue(), that.getValue())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (ObjectUtils.nullSafeHashCode(this.key) ^ ObjectUtils.nullSafeHashCode(this.value));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (this.key + "=" + this.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
public final boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof Map.Entry otherEntry)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(getKey(), otherEntry.getKey()) &&
|
||||
ObjectUtils.nullSafeEquals(getValue(), otherEntry.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int hashCode() {
|
||||
return (ObjectUtils.nullSafeHashCode(this.key) ^ ObjectUtils.nullSafeHashCode(this.value));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ public class MimeType implements Comparable<MimeType>, Serializable {
|
|||
return (thisSuffix.equals(other.getSubtype()) || thisSuffix.equals(otherSuffix));
|
||||
}
|
||||
else if (other.isWildcardSubtype() && otherSuffix != null) {
|
||||
return (this.getSubtype().equals(otherSuffix) || otherSuffix.equals(thisSuffix));
|
||||
return (getSubtype().equals(otherSuffix) || otherSuffix.equals(thisSuffix));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -451,15 +451,10 @@ public class MimeType implements Comparable<MimeType>, Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof MimeType otherType)) {
|
||||
return false;
|
||||
}
|
||||
return (this.type.equalsIgnoreCase(otherType.type) &&
|
||||
return (this == other || (other instanceof MimeType otherType &&
|
||||
this.type.equalsIgnoreCase(otherType.type) &&
|
||||
this.subtype.equalsIgnoreCase(otherType.subtype) &&
|
||||
parametersAreEqual(otherType));
|
||||
parametersAreEqual(otherType)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -107,16 +107,10 @@ public class NullSafeComparator<T> implements Comparator<T> {
|
|||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof NullSafeComparator<?> otherComparator)) {
|
||||
return false;
|
||||
}
|
||||
return (this.nonNullComparator.equals(otherComparator.nonNullComparator)
|
||||
&& this.nullsLow == otherComparator.nullsLow);
|
||||
return (this == other || (other instanceof NullSafeComparator<?> that &&
|
||||
this.nonNullComparator.equals(that.nonNullComparator) &&
|
||||
this.nullsLow == that.nullsLow));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -99,7 +99,7 @@ public class MockPropertySource extends PropertiesPropertySource {
|
|||
* @return this {@link MockPropertySource} instance
|
||||
*/
|
||||
public MockPropertySource withProperty(String name, Object value) {
|
||||
this.setProperty(name, value);
|
||||
setProperty(name, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -82,16 +82,11 @@ public class TypedValue {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof TypedValue otherTv)) {
|
||||
return false;
|
||||
}
|
||||
// Avoid TypeDescriptor initialization if not necessary
|
||||
return (ObjectUtils.nullSafeEquals(this.value, otherTv.value) &&
|
||||
((this.typeDescriptor == null && otherTv.typeDescriptor == null) ||
|
||||
ObjectUtils.nullSafeEquals(getTypeDescriptor(), otherTv.getTypeDescriptor())));
|
||||
return (this == other || (other instanceof TypedValue that &&
|
||||
ObjectUtils.nullSafeEquals(this.value, that.value) &&
|
||||
((this.typeDescriptor == null && that.typeDescriptor == null) ||
|
||||
ObjectUtils.nullSafeEquals(getTypeDescriptor(), that.getTypeDescriptor()))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -591,14 +591,9 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof PropertyCacheKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.clazz == otherKey.clazz && this.property.equals(otherKey.property) &&
|
||||
this.targetIsClass == otherKey.targetIsClass);
|
||||
return (this == other || (other instanceof PropertyCacheKey that &&
|
||||
this.clazz == that.clazz && this.property.equals(that.property) &&
|
||||
this.targetIsClass == that.targetIsClass));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -615,22 +615,17 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ConsumerCacheKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (destinationEquals(otherKey) &&
|
||||
ObjectUtils.nullSafeEquals(this.selector, otherKey.selector) &&
|
||||
ObjectUtils.nullSafeEquals(this.noLocal, otherKey.noLocal) &&
|
||||
ObjectUtils.nullSafeEquals(this.subscription, otherKey.subscription) &&
|
||||
this.durable == otherKey.durable);
|
||||
return (this == other || (other instanceof ConsumerCacheKey that &&
|
||||
destinationEquals(that) &&
|
||||
ObjectUtils.nullSafeEquals(this.selector, that.selector) &&
|
||||
ObjectUtils.nullSafeEquals(this.noLocal, that.noLocal) &&
|
||||
ObjectUtils.nullSafeEquals(this.subscription, that.subscription) &&
|
||||
this.durable == that.durable));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (31 * super.hashCode() + ObjectUtils.nullSafeHashCode(this.selector));
|
||||
return super.hashCode() * 31 + ObjectUtils.nullSafeHashCode(this.selector);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -111,21 +111,15 @@ public class QosSettings {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof QosSettings otherSettings)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (this.deliveryMode == otherSettings.deliveryMode &&
|
||||
this.priority == otherSettings.priority &&
|
||||
this.timeToLive == otherSettings.timeToLive);
|
||||
return (this == other || (other instanceof QosSettings that &&
|
||||
this.deliveryMode == that.deliveryMode &&
|
||||
this.priority == that.priority &&
|
||||
this.timeToLive == that.timeToLive));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (this.deliveryMode * 31 + this.priority);
|
||||
return this.deliveryMode * 31 + this.priority;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -532,14 +532,9 @@ public class MultiServerUserRegistry implements SimpUserRegistry, SmartApplicati
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof SimpSubscription otherSubscription)) {
|
||||
return false;
|
||||
}
|
||||
return (getId().equals(otherSubscription.getId()) &&
|
||||
ObjectUtils.nullSafeEquals(getSession(), otherSubscription.getSession()));
|
||||
return (this == other || (other instanceof SimpSubscription that &&
|
||||
getId().equals(that.getId()) &&
|
||||
ObjectUtils.nullSafeEquals(getSession(), that.getSession())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -90,20 +90,15 @@ public class GenericMessage<T> implements Message<T>, Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof GenericMessage<?> otherMsg)) {
|
||||
return false;
|
||||
}
|
||||
// Using nullSafeEquals for proper array equals comparisons
|
||||
return (ObjectUtils.nullSafeEquals(this.payload, otherMsg.payload) && this.headers.equals(otherMsg.headers));
|
||||
return (this == other || (other instanceof GenericMessage<?> that &&
|
||||
ObjectUtils.nullSafeEquals(this.payload, that.payload) && this.headers.equals(that.headers)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
// Using nullSafeHashCode for proper array hashCode handling
|
||||
return (ObjectUtils.nullSafeHashCode(this.payload) * 23 + this.headers.hashCode());
|
||||
return ObjectUtils.nullSafeHashCode(this.payload) * 23 + this.headers.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -59,14 +59,9 @@ public class TestSimpSubscription implements SimpSubscription {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof SimpSubscription otherSubscription)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(getSession(), otherSubscription.getSession()) &&
|
||||
this.id.equals(otherSubscription.getId()));
|
||||
return (this == other || (other instanceof SimpSubscription that &&
|
||||
ObjectUtils.nullSafeEquals(getSession(), that.getSession()) &&
|
||||
this.id.equals(that.getId())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -54,7 +54,7 @@ public class MockEnvironment extends AbstractEnvironment {
|
|||
* @see MockPropertySource#withProperty
|
||||
*/
|
||||
public MockEnvironment withProperty(String key, String value) {
|
||||
this.setProperty(key, value);
|
||||
setProperty(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -334,20 +334,15 @@ public class ContextConfigurationAttributes {
|
|||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ContextConfigurationAttributes otherAttr)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.declaringClass, otherAttr.declaringClass) &&
|
||||
Arrays.equals(this.classes, otherAttr.classes)) &&
|
||||
Arrays.equals(this.locations, otherAttr.locations) &&
|
||||
this.inheritLocations == otherAttr.inheritLocations &&
|
||||
Arrays.equals(this.initializers, otherAttr.initializers) &&
|
||||
this.inheritInitializers == otherAttr.inheritInitializers &&
|
||||
ObjectUtils.nullSafeEquals(this.name, otherAttr.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.contextLoaderClass, otherAttr.contextLoaderClass);
|
||||
return (this == other || (other instanceof ContextConfigurationAttributes that &&
|
||||
ObjectUtils.nullSafeEquals(this.declaringClass, that.declaringClass) &&
|
||||
Arrays.equals(this.classes, that.classes)) &&
|
||||
Arrays.equals(this.locations, that.locations) &&
|
||||
this.inheritLocations == that.inheritLocations &&
|
||||
Arrays.equals(this.initializers, that.initializers) &&
|
||||
this.inheritInitializers == that.inheritInitializers &&
|
||||
ObjectUtils.nullSafeEquals(this.name, that.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.contextLoaderClass, that.contextLoaderClass));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -112,7 +112,7 @@ public class XpathExpectationsHelper {
|
|||
|
||||
Document document = parseXmlByteArray(content, encoding);
|
||||
NodeList nodeList = evaluateXpath(document, XPathConstants.NODESET, NodeList.class);
|
||||
MatcherAssert.assertThat("XPath " + this.getXpathExpression(), nodeList, matcher);
|
||||
MatcherAssert.assertThat("XPath " + getXpathExpression(), nodeList, matcher);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,15 +68,10 @@ public class Person {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof Person otherPerson)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.name, otherPerson.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.someDouble, otherPerson.someDouble) &&
|
||||
ObjectUtils.nullSafeEquals(this.someBoolean, otherPerson.someBoolean));
|
||||
return (this == other || (other instanceof Person that &&
|
||||
ObjectUtils.nullSafeEquals(this.name, that.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.someDouble, that.someDouble) &&
|
||||
ObjectUtils.nullSafeEquals(this.someBoolean, that.someBoolean)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -65,13 +65,8 @@ public class MatchAlwaysTransactionAttributeSource implements TransactionAttribu
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof MatchAlwaysTransactionAttributeSource otherTas)) {
|
||||
return false;
|
||||
}
|
||||
return ObjectUtils.nullSafeEquals(this.transactionAttribute, otherTas.transactionAttribute);
|
||||
return (this == other || (other instanceof MatchAlwaysTransactionAttributeSource that &&
|
||||
ObjectUtils.nullSafeEquals(this.transactionAttribute, that.transactionAttribute)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -180,13 +180,8 @@ public class RollbackRuleAttribute implements Serializable{
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof RollbackRuleAttribute rhs)) {
|
||||
return false;
|
||||
}
|
||||
return this.exceptionPattern.equals(rhs.exceptionPattern);
|
||||
return (this == other || (other instanceof RollbackRuleAttribute that &&
|
||||
this.exceptionPattern.equals(that.exceptionPattern)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -227,20 +227,15 @@ public final class ContentDisposition {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ContentDisposition otherCd)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(this.type, otherCd.type) &&
|
||||
ObjectUtils.nullSafeEquals(this.name, otherCd.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.filename, otherCd.filename) &&
|
||||
ObjectUtils.nullSafeEquals(this.charset, otherCd.charset) &&
|
||||
ObjectUtils.nullSafeEquals(this.size, otherCd.size) &&
|
||||
ObjectUtils.nullSafeEquals(this.creationDate, otherCd.creationDate)&&
|
||||
ObjectUtils.nullSafeEquals(this.modificationDate, otherCd.modificationDate)&&
|
||||
ObjectUtils.nullSafeEquals(this.readDate, otherCd.readDate));
|
||||
return (this == other || (other instanceof ContentDisposition that &&
|
||||
ObjectUtils.nullSafeEquals(this.type, that.type) &&
|
||||
ObjectUtils.nullSafeEquals(this.name, that.name) &&
|
||||
ObjectUtils.nullSafeEquals(this.filename, that.filename) &&
|
||||
ObjectUtils.nullSafeEquals(this.charset, that.charset) &&
|
||||
ObjectUtils.nullSafeEquals(this.size, that.size) &&
|
||||
ObjectUtils.nullSafeEquals(this.creationDate, that.creationDate)&&
|
||||
ObjectUtils.nullSafeEquals(this.modificationDate, that.modificationDate)&&
|
||||
ObjectUtils.nullSafeEquals(this.readDate, that.readDate)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -57,19 +57,14 @@ public class HttpCookie {
|
|||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.name.hashCode();
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other || (other instanceof HttpCookie that &&
|
||||
this.name.equalsIgnoreCase(that.getName())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof HttpCookie otherCookie)) {
|
||||
return false;
|
||||
}
|
||||
return (this.name.equalsIgnoreCase(otherCookie.getName()));
|
||||
public int hashCode() {
|
||||
return this.name.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -269,14 +269,9 @@ public abstract class HttpRange {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ByteRange otherRange)) {
|
||||
return false;
|
||||
}
|
||||
return (this.firstPos == otherRange.firstPos &&
|
||||
ObjectUtils.nullSafeEquals(this.lastPos, otherRange.lastPos));
|
||||
return (this == other || (other instanceof ByteRange that &&
|
||||
this.firstPos == that.firstPos &&
|
||||
ObjectUtils.nullSafeEquals(this.lastPos, that.lastPos)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -331,13 +326,8 @@ public abstract class HttpRange {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof SuffixByteRange otherRange)) {
|
||||
return false;
|
||||
}
|
||||
return (this.suffixLength == otherRange.suffixLength);
|
||||
return (this == other || (other instanceof SuffixByteRange that &&
|
||||
this.suffixLength == that.suffixLength));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -233,18 +233,13 @@ public class ProblemDetail {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ProblemDetail otherDetail)) {
|
||||
return false;
|
||||
}
|
||||
return (getType().equals(otherDetail.getType()) &&
|
||||
ObjectUtils.nullSafeEquals(getTitle(), otherDetail.getTitle()) &&
|
||||
this.status == otherDetail.status &&
|
||||
ObjectUtils.nullSafeEquals(this.detail, otherDetail.detail) &&
|
||||
ObjectUtils.nullSafeEquals(this.instance, otherDetail.instance) &&
|
||||
ObjectUtils.nullSafeEquals(this.properties, otherDetail.properties));
|
||||
return (this == other || (other instanceof ProblemDetail that &&
|
||||
getType().equals(that.getType()) &&
|
||||
ObjectUtils.nullSafeEquals(getTitle(), that.getTitle()) &&
|
||||
this.status == that.status &&
|
||||
ObjectUtils.nullSafeEquals(this.detail, that.detail) &&
|
||||
ObjectUtils.nullSafeEquals(this.instance, that.instance) &&
|
||||
ObjectUtils.nullSafeEquals(this.properties, that.properties)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -144,15 +144,10 @@ public final class ResponseCookie extends HttpCookie {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ResponseCookie otherCookie)) {
|
||||
return false;
|
||||
}
|
||||
return (getName().equalsIgnoreCase(otherCookie.getName()) &&
|
||||
ObjectUtils.nullSafeEquals(this.path, otherCookie.getPath()) &&
|
||||
ObjectUtils.nullSafeEquals(this.domain, otherCookie.getDomain()));
|
||||
return (this == other ||(other instanceof ResponseCookie that &&
|
||||
getName().equalsIgnoreCase(that.getName()) &&
|
||||
ObjectUtils.nullSafeEquals(this.path, that.getPath()) &&
|
||||
ObjectUtils.nullSafeEquals(this.domain, that.getDomain())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -41,7 +41,7 @@ public class ClientRequestObservationContext extends RequestReplySenderContext<C
|
|||
*/
|
||||
public ClientRequestObservationContext(ClientHttpRequest request) {
|
||||
super(ClientRequestObservationContext::setRequestHeader);
|
||||
this.setCarrier(request);
|
||||
setCarrier(request);
|
||||
}
|
||||
|
||||
private static void setRequestHeader(@Nullable ClientHttpRequest request, String name, String value) {
|
||||
|
|
|
@ -160,7 +160,7 @@ class ReactorNetty2ClientHttpResponse implements ClientHttpResponse {
|
|||
}
|
||||
|
||||
private boolean mayHaveBody(HttpMethod method) {
|
||||
int code = this.getStatusCode().value();
|
||||
int code = getStatusCode().value();
|
||||
return !((code >= 100 && code < 200) || code == 204 || code == 205 ||
|
||||
method.equals(HttpMethod.HEAD) || getHeaders().getContentLength() == 0);
|
||||
}
|
||||
|
|
|
@ -244,13 +244,8 @@ public class ServletContextResource extends AbstractFileResolvingResource implem
|
|||
*/
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ServletContextResource otherRes)) {
|
||||
return false;
|
||||
}
|
||||
return (this.servletContext.equals(otherRes.servletContext) && this.path.equals(otherRes.path));
|
||||
return (this == other || (other instanceof ServletContextResource that &&
|
||||
this.path.equals(that.path) && this.servletContext.equals(that.servletContext)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -161,10 +161,10 @@ public class DelegatingFilterProxy extends GenericFilterBean {
|
|||
*/
|
||||
public DelegatingFilterProxy(String targetBeanName, @Nullable WebApplicationContext wac) {
|
||||
Assert.hasText(targetBeanName, "Target Filter bean name must not be null or empty");
|
||||
this.setTargetBeanName(targetBeanName);
|
||||
setTargetBeanName(targetBeanName);
|
||||
this.webApplicationContext = wac;
|
||||
if (wac != null) {
|
||||
this.setEnvironment(wac.getEnvironment());
|
||||
setEnvironment(wac.getEnvironment());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -257,13 +257,8 @@ public class ControllerAdviceBean implements Ordered {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ControllerAdviceBean otherAdvice)) {
|
||||
return false;
|
||||
}
|
||||
return (this.beanOrName.equals(otherAdvice.beanOrName) && this.beanFactory == otherAdvice.beanFactory);
|
||||
return (this == other || (other instanceof ControllerAdviceBean that &&
|
||||
this.beanOrName.equals(that.beanOrName) && this.beanFactory == that.beanFactory));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -74,7 +74,7 @@ public class HeaderWebSessionIdResolver implements WebSessionIdResolver {
|
|||
|
||||
@Override
|
||||
public void expireSession(ServerWebExchange exchange) {
|
||||
this.setSessionId(exchange, "");
|
||||
setSessionId(exchange, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -554,19 +554,14 @@ final class HierarchicalUriComponents extends UriComponents {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof HierarchicalUriComponents otherComp)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(getScheme(), otherComp.getScheme()) &&
|
||||
ObjectUtils.nullSafeEquals(getUserInfo(), otherComp.getUserInfo()) &&
|
||||
ObjectUtils.nullSafeEquals(getHost(), otherComp.getHost()) &&
|
||||
getPort() == otherComp.getPort() &&
|
||||
this.path.equals(otherComp.path) &&
|
||||
this.queryParams.equals(otherComp.queryParams) &&
|
||||
ObjectUtils.nullSafeEquals(getFragment(), otherComp.getFragment()));
|
||||
return (this == other || (other instanceof HierarchicalUriComponents that &&
|
||||
ObjectUtils.nullSafeEquals(getScheme(), that.getScheme()) &&
|
||||
ObjectUtils.nullSafeEquals(getUserInfo(), that.getUserInfo()) &&
|
||||
ObjectUtils.nullSafeEquals(getHost(), that.getHost()) &&
|
||||
getPort() == that.getPort() &&
|
||||
this.path.equals(that.path) &&
|
||||
this.queryParams.equals(that.queryParams) &&
|
||||
ObjectUtils.nullSafeEquals(getFragment(), that.getFragment())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -158,15 +158,10 @@ final class OpaqueUriComponents extends UriComponents {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof OpaqueUriComponents otherComp)) {
|
||||
return false;
|
||||
}
|
||||
return (ObjectUtils.nullSafeEquals(getScheme(), otherComp.getScheme()) &&
|
||||
ObjectUtils.nullSafeEquals(this.ssp, otherComp.ssp) &&
|
||||
ObjectUtils.nullSafeEquals(getFragment(), otherComp.getFragment()));
|
||||
return (this == other || (other instanceof OpaqueUriComponents that &&
|
||||
ObjectUtils.nullSafeEquals(getScheme(), that.getScheme()) &&
|
||||
ObjectUtils.nullSafeEquals(this.ssp, that.ssp) &&
|
||||
ObjectUtils.nullSafeEquals(getFragment(), that.getFragment())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -432,12 +432,10 @@ public class PathPattern implements Comparable<PathPattern> {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (!(other instanceof PathPattern otherPattern)) {
|
||||
return false;
|
||||
}
|
||||
return (this.patternString.equals(otherPattern.getPatternString()) &&
|
||||
getSeparator() == otherPattern.getSeparator() &&
|
||||
this.caseSensitive == otherPattern.caseSensitive);
|
||||
return (this == other || (other instanceof PathPattern that &&
|
||||
this.patternString.equals(that.getPatternString()) &&
|
||||
getSeparator() == that.getSeparator() &&
|
||||
this.caseSensitive == that.caseSensitive));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -167,18 +167,13 @@ public abstract class ExchangeFilterFunctions {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof Credentials otherCred)) {
|
||||
return false;
|
||||
}
|
||||
return (this.username.equals(otherCred.username) && this.password.equals(otherCred.password));
|
||||
return (this == other ||(other instanceof Credentials that &&
|
||||
this.username.equals(that.username) && this.password.equals(that.password)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 31 * this.username.hashCode() + this.password.hashCode();
|
||||
return this.username.hashCode() * 31 + this.password.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -282,13 +282,8 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ContentChunkInfo otherCci)) {
|
||||
return false;
|
||||
}
|
||||
return (this.start == otherCci.start && this.end == otherCci.end);
|
||||
return (this == other || (other instanceof ContentChunkInfo that &&
|
||||
this.start == that.start && this.end == that.end));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -95,7 +95,7 @@ abstract class AbstractMediaTypeExpression implements Comparable<AbstractMediaTy
|
|||
|
||||
@Override
|
||||
public int compareTo(AbstractMediaTypeExpression other) {
|
||||
MediaType mediaType1 = this.getMediaType();
|
||||
MediaType mediaType1 = getMediaType();
|
||||
MediaType mediaType2 = other.getMediaType();
|
||||
if (mediaType1.isMoreSpecific(mediaType2)) {
|
||||
return -1;
|
||||
|
|
|
@ -340,19 +340,14 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof RequestMappingInfo otherInfo)) {
|
||||
return false;
|
||||
}
|
||||
return (this.patternsCondition.equals(otherInfo.patternsCondition) &&
|
||||
this.methodsCondition.equals(otherInfo.methodsCondition) &&
|
||||
this.paramsCondition.equals(otherInfo.paramsCondition) &&
|
||||
this.headersCondition.equals(otherInfo.headersCondition) &&
|
||||
this.consumesCondition.equals(otherInfo.consumesCondition) &&
|
||||
this.producesCondition.equals(otherInfo.producesCondition) &&
|
||||
this.customConditionHolder.equals(otherInfo.customConditionHolder));
|
||||
return (this == other || (other instanceof RequestMappingInfo that &&
|
||||
this.patternsCondition.equals(that.patternsCondition) &&
|
||||
this.methodsCondition.equals(that.methodsCondition) &&
|
||||
this.paramsCondition.equals(that.paramsCondition) &&
|
||||
this.headersCondition.equals(that.headersCondition) &&
|
||||
this.consumesCondition.equals(that.consumesCondition) &&
|
||||
this.producesCondition.equals(that.producesCondition) &&
|
||||
this.customConditionHolder.equals(that.customConditionHolder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -224,14 +224,9 @@ public final class CloseStatus {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof CloseStatus otherStatus)) {
|
||||
return false;
|
||||
}
|
||||
return (this.code == otherStatus.code &&
|
||||
ObjectUtils.nullSafeEquals(this.reason, otherStatus.reason));
|
||||
return (this == other || (other instanceof CloseStatus that &&
|
||||
this.code == that.code &&
|
||||
ObjectUtils.nullSafeEquals(this.reason, that.reason)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -157,14 +157,9 @@ public class WebSocketMessage {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof WebSocketMessage otherMessage)) {
|
||||
return false;
|
||||
}
|
||||
return (this.type.equals(otherMessage.type) &&
|
||||
ObjectUtils.nullSafeEquals(this.payload, otherMessage.payload));
|
||||
return (this == other || (other instanceof WebSocketMessage that &&
|
||||
this.type.equals(that.type) &&
|
||||
ObjectUtils.nullSafeEquals(this.payload, that.payload)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -162,15 +162,10 @@ public final class FlashMap extends HashMap<String, Object> implements Comparabl
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof FlashMap otherFlashMap)) {
|
||||
return false;
|
||||
}
|
||||
return (super.equals(otherFlashMap) &&
|
||||
ObjectUtils.nullSafeEquals(this.targetRequestPath, otherFlashMap.targetRequestPath) &&
|
||||
this.targetRequestParams.equals(otherFlashMap.targetRequestParams));
|
||||
return (this == other || (other instanceof FlashMap that &&
|
||||
super.equals(other) &&
|
||||
ObjectUtils.nullSafeEquals(this.targetRequestPath, that.targetRequestPath) &&
|
||||
this.targetRequestParams.equals(that.targetRequestParams)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -68,7 +68,7 @@ abstract class AbstractMediaTypeExpression implements MediaTypeExpression, Compa
|
|||
|
||||
@Override
|
||||
public int compareTo(AbstractMediaTypeExpression other) {
|
||||
MediaType mediaType1 = this.getMediaType();
|
||||
MediaType mediaType1 = getMediaType();
|
||||
MediaType mediaType2 = other.getMediaType();
|
||||
if (mediaType1.isMoreSpecific(mediaType2)) {
|
||||
return -1;
|
||||
|
|
|
@ -475,19 +475,14 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof RequestMappingInfo otherInfo)) {
|
||||
return false;
|
||||
}
|
||||
return (getActivePatternsCondition().equals(otherInfo.getActivePatternsCondition()) &&
|
||||
this.methodsCondition.equals(otherInfo.methodsCondition) &&
|
||||
this.paramsCondition.equals(otherInfo.paramsCondition) &&
|
||||
this.headersCondition.equals(otherInfo.headersCondition) &&
|
||||
this.consumesCondition.equals(otherInfo.consumesCondition) &&
|
||||
this.producesCondition.equals(otherInfo.producesCondition) &&
|
||||
this.customConditionHolder.equals(otherInfo.customConditionHolder));
|
||||
return (this == other || (other instanceof RequestMappingInfo that &&
|
||||
getActivePatternsCondition().equals(that.getActivePatternsCondition()) &&
|
||||
this.methodsCondition.equals(that.methodsCondition) &&
|
||||
this.paramsCondition.equals(that.paramsCondition) &&
|
||||
this.headersCondition.equals(that.headersCondition) &&
|
||||
this.consumesCondition.equals(that.consumesCondition) &&
|
||||
this.producesCondition.equals(that.producesCondition) &&
|
||||
this.customConditionHolder.equals(that.customConditionHolder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -231,13 +231,8 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ContentChunkInfo otherCci)) {
|
||||
return false;
|
||||
}
|
||||
return (this.start == otherCci.start && this.end == otherCci.end);
|
||||
return (this == other || (other instanceof ContentChunkInfo that &&
|
||||
this.start == that.start && this.end == that.end));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -234,7 +234,7 @@ public class ScriptTemplateView extends AbstractUrlBasedView {
|
|||
if (this.renderFunction == null && viewConfig.getRenderFunction() != null) {
|
||||
this.renderFunction = viewConfig.getRenderFunction();
|
||||
}
|
||||
if (this.getContentType() == null) {
|
||||
if (getContentType() == null) {
|
||||
setContentType(viewConfig.getContentType() != null ? viewConfig.getContentType() : DEFAULT_CONTENT_TYPE);
|
||||
}
|
||||
if (this.charset == null) {
|
||||
|
@ -467,18 +467,14 @@ public class ScriptTemplateView extends AbstractUrlBasedView {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof EngineKey otherKey)) {
|
||||
return false;
|
||||
}
|
||||
return (this.engineName.equals(otherKey.engineName) && Arrays.equals(this.scripts, otherKey.scripts));
|
||||
return (this == other || (other instanceof EngineKey that &&
|
||||
this.engineName.equals(that.engineName) &&
|
||||
Arrays.equals(this.scripts, that.scripts)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (this.engineName.hashCode() * 29 + Arrays.hashCode(this.scripts));
|
||||
return this.engineName.hashCode() * 29 + Arrays.hashCode(this.scripts);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.springframework.web.servlet.tags.form;
|
|||
import java.beans.PropertyEditorSupport;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* @author Juergen Hoeller
|
||||
|
@ -45,13 +46,8 @@ public class ItemPet {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof ItemPet otherPet)) {
|
||||
return false;
|
||||
}
|
||||
return (this.name != null && this.name.equals(otherPet.getName()));
|
||||
return (this == other || (other instanceof ItemPet that &&
|
||||
ObjectUtils.nullSafeEquals(this.name, that.getName())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -76,13 +76,8 @@ public abstract class AbstractWebSocketMessage<T> implements WebSocketMessage<T>
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof AbstractWebSocketMessage<?> otherMessage)) {
|
||||
return false;
|
||||
}
|
||||
return ObjectUtils.nullSafeEquals(this.payload, otherMessage.payload);
|
||||
return (this == other || (other instanceof AbstractWebSocketMessage<?> that &&
|
||||
ObjectUtils.nullSafeEquals(this.payload, that.payload)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -207,13 +207,8 @@ public final class CloseStatus implements Serializable {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof CloseStatus otherStatus)) {
|
||||
return false;
|
||||
}
|
||||
return (this.code == otherStatus.code && ObjectUtils.nullSafeEquals(this.reason, otherStatus.reason));
|
||||
return (this == other || (other instanceof CloseStatus that &&
|
||||
this.code == that.code && ObjectUtils.nullSafeEquals(this.reason, that.reason)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -309,13 +309,8 @@ public class WebSocketHttpHeaders extends HttpHeaders {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof WebSocketHttpHeaders otherHeaders)) {
|
||||
return false;
|
||||
}
|
||||
return this.headers.equals(otherHeaders.headers);
|
||||
return (this == other || (other instanceof WebSocketHttpHeaders that &&
|
||||
this.headers.equals(that.headers)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -238,8 +238,7 @@ public class DefaultSimpUserRegistry implements SimpUserRegistry, SmartApplicati
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other ||
|
||||
(other instanceof SimpUser otherSimpUser && getName().equals(otherSimpUser.getName())));
|
||||
return (this == other || (other instanceof SimpUser that && getName().equals(that.getName())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -294,8 +293,7 @@ public class DefaultSimpUserRegistry implements SimpUserRegistry, SmartApplicati
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
return (this == other ||
|
||||
(other instanceof SimpSubscription otherSubscription && getId().equals(otherSubscription.getId())));
|
||||
return (this == other || (other instanceof SimpSubscription that && getId().equals(that.getId())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -344,14 +342,9 @@ public class DefaultSimpUserRegistry implements SimpUserRegistry, SmartApplicati
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof SimpSubscription otherSubscription)) {
|
||||
return false;
|
||||
}
|
||||
return (getId().equals(otherSubscription.getId()) &&
|
||||
getSession().getId().equals(otherSubscription.getSession().getId()));
|
||||
return (this == other || (other instanceof SimpSubscription that &&
|
||||
getId().equals(that.getId()) &&
|
||||
getSession().getId().equals(that.getSession().getId())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -122,13 +122,8 @@ public class SockJsFrame {
|
|||
|
||||
@Override
|
||||
public boolean equals(@Nullable Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof SockJsFrame otherFrame)) {
|
||||
return false;
|
||||
}
|
||||
return (this.type.equals(otherFrame.type) && this.content.equals(otherFrame.content));
|
||||
return (this == other || (other instanceof SockJsFrame that &&
|
||||
this.type.equals(that.type) && this.content.equals(that.content)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue