Skip to content

Commit f4676bb

Browse files
committed
Restore short-circuiting in equals implementation
Closes gh-24048
1 parent 262332a commit f4676bb

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,28 +1128,28 @@ public boolean equals(Object other) {
11281128
}
11291129
AbstractBeanDefinition that = (AbstractBeanDefinition) other;
11301130
boolean rtn = ObjectUtils.nullSafeEquals(getBeanClassName(), that.getBeanClassName());
1131-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.scope, that.scope);
1132-
rtn = rtn &= this.abstractFlag == that.abstractFlag;
1133-
rtn = rtn &= this.lazyInit == that.lazyInit;
1134-
rtn = rtn &= this.autowireMode == that.autowireMode;
1135-
rtn = rtn &= this.dependencyCheck == that.dependencyCheck;
1136-
rtn = rtn &= Arrays.equals(this.dependsOn, that.dependsOn);
1137-
rtn = rtn &= this.autowireCandidate == that.autowireCandidate;
1138-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers);
1139-
rtn = rtn &= this.primary == that.primary;
1140-
rtn = rtn &= this.nonPublicAccessAllowed == that.nonPublicAccessAllowed;
1141-
rtn = rtn &= this.lenientConstructorResolution == that.lenientConstructorResolution;
1142-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues);
1143-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues);
1144-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides);
1145-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName);
1146-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName);
1147-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName);
1148-
rtn = rtn &= this.enforceInitMethod == that.enforceInitMethod;
1149-
rtn = rtn &= ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName);
1150-
rtn = rtn &= this.enforceDestroyMethod == that.enforceDestroyMethod;
1151-
rtn = rtn &= this.synthetic == that.synthetic;
1152-
rtn = rtn &= this.role == that.role;
1131+
rtn = rtn && ObjectUtils.nullSafeEquals(this.scope, that.scope);
1132+
rtn = rtn && this.abstractFlag == that.abstractFlag;
1133+
rtn = rtn && this.lazyInit == that.lazyInit;
1134+
rtn = rtn && this.autowireMode == that.autowireMode;
1135+
rtn = rtn && this.dependencyCheck == that.dependencyCheck;
1136+
rtn = rtn && Arrays.equals(this.dependsOn, that.dependsOn);
1137+
rtn = rtn && this.autowireCandidate == that.autowireCandidate;
1138+
rtn = rtn && ObjectUtils.nullSafeEquals(this.qualifiers, that.qualifiers);
1139+
rtn = rtn && this.primary == that.primary;
1140+
rtn = rtn && this.nonPublicAccessAllowed == that.nonPublicAccessAllowed;
1141+
rtn = rtn && this.lenientConstructorResolution == that.lenientConstructorResolution;
1142+
rtn = rtn && ObjectUtils.nullSafeEquals(this.constructorArgumentValues, that.constructorArgumentValues);
1143+
rtn = rtn && ObjectUtils.nullSafeEquals(this.propertyValues, that.propertyValues);
1144+
rtn = rtn && ObjectUtils.nullSafeEquals(this.methodOverrides, that.methodOverrides);
1145+
rtn = rtn && ObjectUtils.nullSafeEquals(this.factoryBeanName, that.factoryBeanName);
1146+
rtn = rtn && ObjectUtils.nullSafeEquals(this.factoryMethodName, that.factoryMethodName);
1147+
rtn = rtn && ObjectUtils.nullSafeEquals(this.initMethodName, that.initMethodName);
1148+
rtn = rtn && this.enforceInitMethod == that.enforceInitMethod;
1149+
rtn = rtn && ObjectUtils.nullSafeEquals(this.destroyMethodName, that.destroyMethodName);
1150+
rtn = rtn && this.enforceDestroyMethod == that.enforceDestroyMethod;
1151+
rtn = rtn && this.synthetic == that.synthetic;
1152+
rtn = rtn && this.role == that.role;
11531153
return rtn && super.equals(other);
11541154
}
11551155

0 commit comments

Comments
 (0)