From: Teryk Bellahsene Date: Mon, 29 Feb 2016 09:48:12 +0000 (+0100) Subject: Fix quality flaw X-Git-Tag: 5.5-M6~95 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7df0d29c7b0c52c23695b408a49e17062a2eec98;p=sonarqube.git Fix quality flaw --- diff --git a/sonar-db/src/main/java/org/sonar/db/qualityprofile/SqlActiveRuleKey.java b/sonar-db/src/main/java/org/sonar/db/qualityprofile/SqlActiveRuleKey.java index 3eeefc33e54..908569d7124 100644 --- a/sonar-db/src/main/java/org/sonar/db/qualityprofile/SqlActiveRuleKey.java +++ b/sonar-db/src/main/java/org/sonar/db/qualityprofile/SqlActiveRuleKey.java @@ -45,6 +45,29 @@ public class SqlActiveRuleKey implements Comparable { 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; }