Skip to content

Commit 00bc536

Browse files
author
Vincent Potucek
committed
Pull spring-projects#34809: fix 'if' statement can be simplified
1 parent 34fa389 commit 00bc536

File tree

110 files changed

+162
-605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+162
-605
lines changed

gradle.properties

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
version=7.0.0-SNAPSHOT
2-
2+
kotlin.jvm.target.validation.mode=ignore
3+
kotlin.stdlib.default.dependency=false
4+
kotlinVersion=2.1.20
35
org.gradle.caching=true
46
org.gradle.jvmargs=-Xmx4g
57
org.gradle.parallel=true
6-
kotlinVersion=2.1.20
7-
8-
kotlin.jvm.target.validation.mode=ignore
9-
kotlin.stdlib.default.dependency=false

import-into-eclipse.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ _When instructed to execute `./gradlew` from the command line, be sure to execut
4848
1. While JUnit tests pass from the command line with Gradle, some may fail when run from
4949
the IDE.
5050
- Resolving this is a work in progress.
51-
- If attempting to run all JUnit tests from within the IDE, you may need to set the following VM options to avoid out of memory errors: `-XX:MaxPermSize=2g -Xmx2g -XX:MaxHeapSize=2g`
51+
- If attempting to run all JUnit tests from within the IDE, you may need to set the following VM options to avoid out of memory errors: `-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m`
5252

5353
## Tips
5454

import-into-idea.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ IntelliJ IDEA. See https://youtrack.jetbrains.com/issue/IDEA-64446 for details.
1919
3. While JUnit tests pass from the command line with Gradle, some may fail when run from
2020
IntelliJ IDEA. Resolving this is a work in progress. If attempting to run all JUnit tests from within
2121
IntelliJ IDEA, you will likely need to set the following VM options to avoid out of memory errors:
22-
-XX:MaxPermSize=2g -Xmx2g -XX:MaxHeapSize=2g
22+
-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m
2323
4. If you invoke "Rebuild Project" in the IDE, you'll have to generate some test
2424
resources of the `spring-oxm` module again (`./gradlew :spring-oxm:compileTestJava`)
2525

integration-tests/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementIntegrationTests.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,7 @@ private void assertTxProxying(AnnotationConfigApplicationContext ctx) {
146146
}
147147

148148
private boolean isTxProxy(FooRepository repo) {
149-
if (!AopUtils.isAopProxy(repo)) {
150-
return false;
151-
}
152-
return Arrays.stream(((Advised) repo).getAdvisors())
149+
return AopUtils.isAopProxy(repo) && Arrays.stream(((Advised) repo).getAdvisors())
153150
.anyMatch(BeanFactoryTransactionAttributeSourceAdvisor.class::isInstance);
154151
}
155152

spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator {
4141

4242
@Override
4343
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
44-
boolean proxyTargetClass = true;
45-
if (node instanceof Element ele && ele.hasAttribute(PROXY_TARGET_CLASS)) {
46-
proxyTargetClass = Boolean.parseBoolean(ele.getAttribute(PROXY_TARGET_CLASS));
47-
}
44+
boolean proxyTargetClass = !(node instanceof Element ele) || !ele.hasAttribute(PROXY_TARGET_CLASS) || Boolean.parseBoolean(ele.getAttribute(PROXY_TARGET_CLASS));
4845

4946
// Register the original bean definition as it will be referenced by the scoped proxy
5047
// and is relevant for tooling (validation, navigation).

spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AutoProxyUtils.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,7 @@ static void exposeTargetClass(
126126
* @see AutowireCapableBeanFactory#ORIGINAL_INSTANCE_SUFFIX
127127
*/
128128
static boolean isOriginalInstance(String beanName, Class<?> beanClass) {
129-
if (!StringUtils.hasLength(beanName) || beanName.length() !=
130-
beanClass.getName().length() + AutowireCapableBeanFactory.ORIGINAL_INSTANCE_SUFFIX.length()) {
131-
return false;
132-
}
133-
return (beanName.startsWith(beanClass.getName()) &&
129+
return StringUtils.hasLength(beanName) && beanName.length() == beanClass.getName().length() + AutowireCapableBeanFactory.ORIGINAL_INSTANCE_SUFFIX.length() && (beanName.startsWith(beanClass.getName()) &&
134130
beanName.endsWith(AutowireCapableBeanFactory.ORIGINAL_INSTANCE_SUFFIX));
135131
}
136132

spring-aspects/src/test/java/org/springframework/cache/config/TestEntity.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ public int hashCode() {
5050

5151
@Override
5252
public boolean equals(@Nullable Object obj) {
53-
if (obj == this) {
54-
return true;
55-
}
56-
return (obj instanceof TestEntity that && ObjectUtils.nullSafeEquals(this.id, that.id));
53+
return obj == this || (obj instanceof TestEntity that && ObjectUtils.nullSafeEquals(this.id, that.id));
5754
}
5855

5956
}

spring-beans/src/main/java/org/springframework/beans/PropertyAccessorUtils.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,7 @@ public static boolean matchesProperty(String registeredPath, String propertyPath
124124
if (registeredPath.length() == propertyPath.length()) {
125125
return true;
126126
}
127-
if (registeredPath.charAt(propertyPath.length()) != PropertyAccessor.PROPERTY_KEY_PREFIX_CHAR) {
128-
return false;
129-
}
130-
return (registeredPath.indexOf(PropertyAccessor.PROPERTY_KEY_SUFFIX_CHAR, propertyPath.length() + 1) ==
127+
return registeredPath.charAt(propertyPath.length()) == PropertyAccessor.PROPERTY_KEY_PREFIX_CHAR && (registeredPath.indexOf(PropertyAccessor.PROPERTY_KEY_SUFFIX_CHAR, propertyPath.length() + 1) ==
131128
registeredPath.length() - 1);
132129
}
133130

spring-beans/src/main/java/org/springframework/beans/factory/annotation/InitDestroyAnnotationBeanPostProcessor.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -471,13 +471,10 @@ public int hashCode() {
471471
*/
472472
private static boolean isPrivateOrNotVisible(Method method, Class<?> beanClass) {
473473
int modifiers = method.getModifiers();
474-
if (Modifier.isPrivate(modifiers)) {
475-
return true;
476-
}
474+
return Modifier.isPrivate(modifiers) || (!method.getDeclaringClass().getPackageName().equals(beanClass.getPackageName()) &&
475+
!(Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)));
477476
// Method is declared in a class that resides in a different package
478477
// than the bean class and the method is neither public nor protected?
479-
return (!method.getDeclaringClass().getPackageName().equals(beanClass.getPackageName()) &&
480-
!(Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)));
481478
}
482479

483480
}

spring-beans/src/main/java/org/springframework/beans/factory/annotation/InjectionMetadata.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,7 @@ protected final void checkResourceType(Class<?> resourceType) {
249249
* @since 6.0.10
250250
*/
251251
protected boolean shouldInject(@Nullable PropertyValues pvs) {
252-
if (this.isField) {
253-
return true;
254-
}
255-
return !checkPropertySkipping(pvs);
252+
return this.isField || !checkPropertySkipping(pvs);
256253
}
257254

258255
/**

spring-beans/src/main/java/org/springframework/beans/factory/aot/AutowiredArgumentsCodeGenerator.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,10 @@ private boolean isAmbiguous() {
8383
.filter(Predicate.not(constructor::equals))
8484
.anyMatch(this::hasSameParameterCount);
8585
}
86-
if (this.executable instanceof Method method) {
87-
return Arrays.stream(ReflectionUtils.getAllDeclaredMethods(this.target))
88-
.filter(Predicate.not(method::equals))
89-
.filter(candidate -> candidate.getName().equals(method.getName()))
90-
.anyMatch(this::hasSameParameterCount);
91-
}
92-
return true;
86+
return !(this.executable instanceof Method method) || Arrays.stream(ReflectionUtils.getAllDeclaredMethods(this.target))
87+
.filter(Predicate.not(method::equals))
88+
.filter(candidate -> candidate.getName().equals(method.getName()))
89+
.anyMatch(this::hasSameParameterCount);
9390
}
9491

9592
private boolean hasSameParameterCount(Executable executable) {

spring-beans/src/main/java/org/springframework/beans/factory/aot/DefaultBeanRegistrationCodeFragments.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,7 @@ private boolean targetTypeNecessary(ResolvableType beanType, @Nullable Class<?>
156156
if (beanType.hasGenerics()) {
157157
return true;
158158
}
159-
if (beanClass != null && this.registeredBean.getMergedBeanDefinition().getFactoryMethodName() != null) {
160-
return true;
161-
}
162-
return (beanClass != null && !beanType.toClass().equals(ClassUtils.getUserClass(beanClass)));
159+
return beanClass != null && this.registeredBean.getMergedBeanDefinition().getFactoryMethodName() != null || (beanClass != null && !beanType.toClass().equals(ClassUtils.getUserClass(beanClass)));
163160
}
164161

165162
@Override

spring-beans/src/main/java/org/springframework/beans/factory/config/DependencyDescriptor.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,7 @@ public boolean equals(@Nullable Object other) {
399399
if (this == other) {
400400
return true;
401401
}
402-
if (!super.equals(other)) {
403-
return false;
404-
}
405-
return (other instanceof DependencyDescriptor otherDesc && this.required == otherDesc.required &&
402+
return super.equals(other) && (other instanceof DependencyDescriptor otherDesc && this.required == otherDesc.required &&
406403
this.eager == otherDesc.eager && this.nestingLevel == otherDesc.nestingLevel &&
407404
this.containingClass == otherDesc.containingClass);
408405
}

spring-beans/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,7 @@ else if ("ref".equals(name)) {
393393
else {
394394
refName = args[0].toString();
395395
}
396-
boolean parentRef = false;
397-
if (args.length > 1 && args[1] instanceof Boolean bool) {
398-
parentRef = bool;
399-
}
396+
boolean parentRef = args.length > 1 && args[1] instanceof Boolean bool && bool;
400397
return new RuntimeBeanReference(refName, parentRef);
401398
}
402399
else if (this.namespaces.containsKey(name) && args.length > 0 && args[0] instanceof Closure) {

spring-beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java

+3-12
Original file line numberDiff line numberDiff line change
@@ -1187,10 +1187,7 @@ private boolean match(
11871187
}
11881188

11891189
private boolean isMatch(ResolvableType parameterType, ResolvableType valueType, FallbackMode fallbackMode) {
1190-
if (isAssignable(valueType).test(parameterType)) {
1191-
return true;
1192-
}
1193-
return switch (fallbackMode) {
1190+
return isAssignable(valueType).test(parameterType) || switch (fallbackMode) {
11941191
case ASSIGNABLE_ELEMENT -> isAssignable(valueType).test(extractElementType(parameterType));
11951192
case TYPE_CONVERSION -> typeConversionFallback(valueType).test(parameterType);
11961193
default -> false;
@@ -1213,10 +1210,7 @@ private ResolvableType extractElementType(ResolvableType parameterType) {
12131210

12141211
private Predicate<ResolvableType> typeConversionFallback(ResolvableType valueType) {
12151212
return parameterType -> {
1216-
if (valueOrCollection(valueType, this::isStringForClassFallback).test(parameterType)) {
1217-
return true;
1218-
}
1219-
return valueOrCollection(valueType, this::isSimpleValueType).test(parameterType);
1213+
return valueOrCollection(valueType, this::isStringForClassFallback).test(parameterType) || valueOrCollection(valueType, this::isSimpleValueType).test(parameterType);
12201214
};
12211215
}
12221216

@@ -1227,10 +1221,7 @@ private Predicate<ResolvableType> valueOrCollection(ResolvableType valueType,
12271221
if (predicateProvider.apply(valueType).test(parameterType)) {
12281222
return true;
12291223
}
1230-
if (predicateProvider.apply(extractElementType(valueType)).test(extractElementType(parameterType))) {
1231-
return true;
1232-
}
1233-
return (predicateProvider.apply(valueType).test(extractElementType(parameterType)));
1224+
return predicateProvider.apply(extractElementType(valueType)).test(extractElementType(parameterType)) || (predicateProvider.apply(valueType).test(extractElementType(parameterType)));
12341225
};
12351226
}
12361227

spring-beans/src/main/java/org/springframework/beans/factory/support/GenericTypeAwareAutowireCandidateResolver.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,8 @@ public void setBeanFactory(BeanFactory beanFactory) {
6161

6262
@Override
6363
public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) {
64-
if (!super.isAutowireCandidate(bdHolder, descriptor)) {
65-
// If explicitly false, do not proceed with any other checks...
66-
return false;
67-
}
68-
return checkGenericTypeMatch(bdHolder, descriptor);
64+
// If explicitly false, do not proceed with any other checks...
65+
return super.isAutowireCandidate(bdHolder, descriptor) && checkGenericTypeMatch(bdHolder, descriptor);
6966
}
7067

7168
/**

spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,7 @@ public boolean isExternallyManagedInitMethod(String initMethod) {
532532
*/
533533
boolean hasAnyExternallyManagedInitMethod(String initMethod) {
534534
synchronized (this.postProcessingLock) {
535-
if (isExternallyManagedInitMethod(initMethod)) {
536-
return true;
537-
}
538-
return hasAnyExternallyManagedMethod(this.externallyManagedInitMethods, initMethod);
535+
return isExternallyManagedInitMethod(initMethod) || hasAnyExternallyManagedMethod(this.externallyManagedInitMethods, initMethod);
539536
}
540537
}
541538

@@ -607,10 +604,7 @@ public boolean isExternallyManagedDestroyMethod(String destroyMethod) {
607604
*/
608605
boolean hasAnyExternallyManagedDestroyMethod(String destroyMethod) {
609606
synchronized (this.postProcessingLock) {
610-
if (isExternallyManagedDestroyMethod(destroyMethod)) {
611-
return true;
612-
}
613-
return hasAnyExternallyManagedMethod(this.externallyManagedDestroyMethods, destroyMethod);
607+
return isExternallyManagedDestroyMethod(destroyMethod) || hasAnyExternallyManagedMethod(this.externallyManagedDestroyMethods, destroyMethod);
614608
}
615609
}
616610

spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,7 @@ public boolean containsBean(String name) {
205205
public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
206206
Object bean = getBean(name);
207207
// In case of FactoryBean, return singleton status of created object.
208-
if (bean instanceof FactoryBean<?> factoryBean) {
209-
return factoryBean.isSingleton();
210-
}
211-
return true;
208+
return !(bean instanceof FactoryBean<?> factoryBean) || factoryBean.isSingleton();
212209
}
213210

214211
@Override

spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -879,10 +879,7 @@ private boolean hasReadMethodForProperty(BeanInfo beanInfo, String propertyName)
879879
private boolean hasIndexedWriteMethodForProperty(BeanInfo beanInfo, String propertyName) {
880880
for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
881881
if (pd.getName().equals(propertyName)) {
882-
if (!(pd instanceof IndexedPropertyDescriptor)) {
883-
return false;
884-
}
885-
return ((IndexedPropertyDescriptor)pd).getIndexedWriteMethod() != null;
882+
return pd instanceof IndexedPropertyDescriptor && ((IndexedPropertyDescriptor) pd).getIndexedWriteMethod() != null;
886883
}
887884
}
888885
return false;
@@ -891,10 +888,7 @@ private boolean hasIndexedWriteMethodForProperty(BeanInfo beanInfo, String prope
891888
private boolean hasIndexedReadMethodForProperty(BeanInfo beanInfo, String propertyName) {
892889
for (PropertyDescriptor pd : beanInfo.getPropertyDescriptors()) {
893890
if (pd.getName().equals(propertyName)) {
894-
if (!(pd instanceof IndexedPropertyDescriptor)) {
895-
return false;
896-
}
897-
return ((IndexedPropertyDescriptor)pd).getIndexedReadMethod() != null;
891+
return pd instanceof IndexedPropertyDescriptor && ((IndexedPropertyDescriptor) pd).getIndexedReadMethod() != null;
898892
}
899893
}
900894
return false;

spring-beans/src/testFixtures/java/org/springframework/beans/testfixture/beans/NestedTestBean.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ public String getCompany() {
4646

4747
@Override
4848
public boolean equals(@Nullable Object obj) {
49-
if (!(obj instanceof NestedTestBean ntb)) {
50-
return false;
51-
}
52-
return this.company.equals(ntb.company);
49+
return obj instanceof NestedTestBean ntb && this.company.equals(ntb.company);
5350
}
5451

5552
@Override

spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/JCacheOperationSourcePointcut.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ private final class JCacheOperationSourceClassFilter implements ClassFilter {
7979

8080
@Override
8181
public boolean matches(Class<?> clazz) {
82-
if (CacheManager.class.isAssignableFrom(clazz)) {
83-
return false;
84-
}
85-
return (cacheOperationSource == null || cacheOperationSource.isCandidateClass(clazz));
82+
return !CacheManager.class.isAssignableFrom(clazz) && (cacheOperationSource == null || cacheOperationSource.isCandidateClass(clazz));
8683
}
8784

8885
private @Nullable JCacheOperationSource getCacheOperationSource() {

spring-context/src/main/java/org/springframework/cache/interceptor/CacheOperationSourcePointcut.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ private final class CacheOperationSourceClassFilter implements ClassFilter {
8181

8282
@Override
8383
public boolean matches(Class<?> clazz) {
84-
if (CacheManager.class.isAssignableFrom(clazz)) {
85-
return false;
86-
}
87-
return (cacheOperationSource == null || cacheOperationSource.isCandidateClass(clazz));
84+
return !CacheManager.class.isAssignableFrom(clazz) && (cacheOperationSource == null || cacheOperationSource.isCandidateClass(clazz));
8885
}
8986

9087
private @Nullable CacheOperationSource getCacheOperationSource() {

spring-context/src/main/java/org/springframework/context/annotation/ComponentScanBeanDefinitionParser.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ public class ComponentScanBeanDefinitionParser implements BeanDefinitionParser {
9494
}
9595

9696
protected ClassPathBeanDefinitionScanner configureScanner(ParserContext parserContext, Element element) {
97-
boolean useDefaultFilters = true;
98-
if (element.hasAttribute(USE_DEFAULT_FILTERS_ATTRIBUTE)) {
99-
useDefaultFilters = Boolean.parseBoolean(element.getAttribute(USE_DEFAULT_FILTERS_ATTRIBUTE));
100-
}
97+
boolean useDefaultFilters = !element.hasAttribute(USE_DEFAULT_FILTERS_ATTRIBUTE) || Boolean.parseBoolean(element.getAttribute(USE_DEFAULT_FILTERS_ATTRIBUTE));
10198

10299
// Delegate bean definition registration to scanner class.
103100
ClassPathBeanDefinitionScanner scanner = createScanner(parserContext.getReaderContext(), useDefaultFilters);
@@ -147,10 +144,7 @@ protected void registerComponents(
147144
}
148145

149146
// Register annotation config processors, if necessary.
150-
boolean annotationConfig = true;
151-
if (element.hasAttribute(ANNOTATION_CONFIG_ATTRIBUTE)) {
152-
annotationConfig = Boolean.parseBoolean(element.getAttribute(ANNOTATION_CONFIG_ATTRIBUTE));
153-
}
147+
boolean annotationConfig = !element.hasAttribute(ANNOTATION_CONFIG_ATTRIBUTE) || Boolean.parseBoolean(element.getAttribute(ANNOTATION_CONFIG_ATTRIBUTE));
154148
if (annotationConfig) {
155149
Set<BeanDefinitionHolder> processorDefinitions =
156150
AnnotationConfigUtils.registerAnnotationConfigProcessors(readerContext.getRegistry(), source);

spring-context/src/main/java/org/springframework/jmx/export/assembler/MethodExclusionMBeanInfoAssembler.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ protected boolean isNotIgnored(Method method, String beanKey) {
118118
return !methodNames.contains(method.getName());
119119
}
120120
}
121-
if (this.ignoredMethods != null) {
122-
return !this.ignoredMethods.contains(method.getName());
123-
}
124-
return true;
121+
return this.ignoredMethods == null || !this.ignoredMethods.contains(method.getName());
125122
}
126123

127124
}

spring-context/src/main/java/org/springframework/scheduling/support/CompositeCronField.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ public boolean equals(@Nullable Object o) {
8181
if (this == o) {
8282
return true;
8383
}
84-
if (!(o instanceof CompositeCronField other)) {
85-
return false;
86-
}
87-
return type() == other.type() &&
84+
return o instanceof CompositeCronField other && type() == other.type() &&
8885
this.value.equals(other.value);
8986
}
9087

spring-context/src/main/java/org/springframework/validation/FieldError.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@ public boolean equals(@Nullable Object other) {
103103
if (this == other) {
104104
return true;
105105
}
106-
if (!super.equals(other)) {
107-
return false;
108-
}
109-
return (other instanceof FieldError otherError && getField().equals(otherError.getField()) &&
106+
return super.equals(other) && (other instanceof FieldError otherError && getField().equals(otherError.getField()) &&
110107
ObjectUtils.nullSafeEquals(getRejectedValue(), otherError.getRejectedValue()) &&
111108
isBindingFailure() == otherError.isBindingFailure());
112109
}

spring-context/src/main/java/org/springframework/validation/method/ParameterValidationResult.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,7 @@ public boolean equals(@Nullable Object other) {
167167
if (this == other) {
168168
return true;
169169
}
170-
if (!super.equals(other)) {
171-
return false;
172-
}
173-
return (other instanceof ParameterValidationResult otherResult &&
170+
return super.equals(other) && (other instanceof ParameterValidationResult otherResult &&
174171
getMethodParameter().equals(otherResult.getMethodParameter()) &&
175172
ObjectUtils.nullSafeEquals(getArgument(), otherResult.getArgument()) &&
176173
ObjectUtils.nullSafeEquals(getContainerIndex(), otherResult.getContainerIndex()) &&

0 commit comments

Comments
 (0)