From 779366ccadc9ce7bf8b3938e8b0001eabbc4c796 Mon Sep 17 00:00:00 2001 From: Ken Stevens Date: Sun, 3 Nov 2019 15:52:32 -0500 Subject: [PATCH] final hashcode equals fix --- .../migrate/taskdef/ExecuteRawSqlTask.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java index 857fd6207bc..f0cce4be291 100644 --- a/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java +++ b/hapi-fhir-jpaserver-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/taskdef/ExecuteRawSqlTask.java @@ -22,6 +22,8 @@ package ca.uhn.fhir.jpa.migrate.taskdef; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import org.apache.commons.lang3.Validate; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import org.intellij.lang.annotations.Language; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -75,4 +77,24 @@ public class ExecuteRawSqlTask extends BaseTask { } } + + @Override + public boolean equals(Object theO) { + if (this == theO) return true; + + if (!(theO instanceof ExecuteRawSqlTask)) return false; + + ExecuteRawSqlTask that = (ExecuteRawSqlTask) theO; + + return new EqualsBuilder() + .append(myDriverNeutralSqls, that.myDriverNeutralSqls) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37) + .append(myDriverNeutralSqls) + .toHashCode(); + } }