aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-02-29 10:48:12 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-02-29 10:48:19 +0100
commit7df0d29c7b0c52c23695b408a49e17062a2eec98 (patch)
treecada98b5782bbc228f955772ec97386cceb4cc11 /sonar-db
parent9f98785363d377ca3d320dc8c26e8ed87efcd180 (diff)
downloadsonarqube-7df0d29c7b0c52c23695b408a49e17062a2eec98.tar.gz
sonarqube-7df0d29c7b0c52c23695b408a49e17062a2eec98.zip
Fix quality flaw
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/qualityprofile/SqlActiveRuleKey.java23
1 files changed, 23 insertions, 0 deletions
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<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;
}