From 7df0d29c7b0c52c23695b408a49e17062a2eec98 Mon Sep 17 00:00:00 2001 From: Teryk Bellahsene Date: Mon, 29 Feb 2016 10:48:12 +0100 Subject: [PATCH] Fix quality flaw --- .../db/qualityprofile/SqlActiveRuleKey.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) 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; } -- 2.39.5