Add equals & hashCode into IntWebExchangeBindEx

According Sonar report we need to re-implement `equals()` & `hashCode()`
methods in the `IntegrationWebExchangeBindException` since it
extends a `WebExchangeBindException` with those methods
This commit is contained in:
Artem Bilan
2019-06-28 09:43:28 -04:00
parent cc87c1b1b0
commit 890cd1feb9

View File

@@ -16,6 +16,8 @@
package org.springframework.integration.http.support;
import java.util.Objects;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.support.WebExchangeBindException;
@@ -62,4 +64,25 @@ public class IntegrationWebExchangeBindException extends WebExchangeBindExceptio
return sb.toString();
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof IntegrationWebExchangeBindException)) {
return false;
}
if (!super.equals(o)) {
return false;
}
IntegrationWebExchangeBindException that = (IntegrationWebExchangeBindException) o;
return Objects.equals(this.endpointId, that.endpointId) &&
Objects.equals(this.failedPayload, that.failedPayload);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), this.endpointId, this.failedPayload);
}
}