]> source.dussan.org Git - sonarqube.git/commitdiff
add QualityGateStatus#equals to fix MeasureRepoEntry#equalsByQualityGateStatus
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Thu, 27 Aug 2015 07:19:21 +0000 (09:19 +0200)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Sat, 29 Aug 2015 13:58:42 +0000 (15:58 +0200)
server/sonar-server/src/main/java/org/sonar/server/computation/measure/QualityGateStatus.java

index 3dfee2ca1504212bf6d776dd89d02ddf801476fb..b3b717a68b80c51664b8b2375a8963ccfb2b9204 100644 (file)
@@ -59,6 +59,23 @@ public final class QualityGateStatus {
     return text;
   }
 
+  @Override
+  public boolean equals(@Nullable Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    QualityGateStatus that = (QualityGateStatus) o;
+    return status == that.status && java.util.Objects.equals(text, that.text);
+  }
+
+  @Override
+  public int hashCode() {
+    return java.util.Objects.hash(status, text);
+  }
+
   @Override
   public String toString() {
     return Objects.toStringHelper(this)