This commit is contained in:
Stéphane Nicoll
2024-06-11 11:58:19 +02:00
parent 28f62abda4
commit 1be92f82af
2 changed files with 11 additions and 11 deletions

View File

@@ -159,14 +159,14 @@ public abstract class OverrideMetadata {
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
public boolean equals(Object other) {
if (other == this) {
return true;
}
if (obj == null || !getClass().isAssignableFrom(obj.getClass())) {
if (other == null || !getClass().isAssignableFrom(other.getClass())) {
return false;
}
OverrideMetadata that = (OverrideMetadata) obj;
OverrideMetadata that = (OverrideMetadata) other;
if (!Objects.equals(this.beanType.getType(), that.beanType.getType()) ||
!Objects.equals(this.beanName, that.beanName) ||
!Objects.equals(this.strategy, that.strategy)) {

View File

@@ -83,17 +83,17 @@ abstract class MockitoOverrideMetadata extends OverrideMetadata {
}
@Override
public boolean equals(@Nullable Object obj) {
if (obj == this) {
public boolean equals(@Nullable Object other) {
if (other == this) {
return true;
}
if (obj == null || !getClass().isAssignableFrom(obj.getClass())) {
if (other == null || !getClass().isAssignableFrom(other.getClass())) {
return false;
}
MockitoOverrideMetadata other = (MockitoOverrideMetadata) obj;
boolean result = super.equals(obj);
result = result && ObjectUtils.nullSafeEquals(this.reset, other.reset);
result = result && ObjectUtils.nullSafeEquals(this.proxyTargetAware, other.proxyTargetAware);
MockitoOverrideMetadata that = (MockitoOverrideMetadata) other;
boolean result = super.equals(that);
result = result && ObjectUtils.nullSafeEquals(this.reset, that.reset);
result = result && ObjectUtils.nullSafeEquals(this.proxyTargetAware, that.proxyTargetAware);
return result;
}