]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaw
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 29 Feb 2016 09:48:12 +0000 (10:48 +0100)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Mon, 29 Feb 2016 09:48:19 +0000 (10:48 +0100)
sonar-db/src/main/java/org/sonar/db/qualityprofile/SqlActiveRuleKey.java

index 3eeefc33e545987269d6d286429dae30b729a6aa..908569d7124cbb7ed5b90b9004c79940af724f98 100644 (file)
@@ -45,6 +45,29 @@ public class SqlActiveRuleKey implements Comparable<SqlActiveRuleKey> {
     return repository.compareTo(o.repository);
   }
 
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    SqlActiveRuleKey activeRuleKey = (SqlActiveRuleKey) o;
+    return qProfile.equals(activeRuleKey.qProfile)
+      && rule.equals(activeRuleKey.rule)
+      && repository.equals(activeRuleKey.repository);
+  }
+
+  @Override
+  public int hashCode() {
+    int result = qProfile.hashCode();
+    result = 31 * result + rule.hashCode();
+    result = 31 * result + repository.hashCode();
+    return result;
+  }
+
   public String getqProfile() {
     return qProfile;
   }