diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-02-23 09:50:27 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-02-23 10:43:33 +0100 |
commit | 7efdaa4a6e4f2ce8cbcc024e74407ccb13a413d3 (patch) | |
tree | bf6b55758b269db80629c6098f0a094d72dddbab /sonar-plugin-api/src/main/java | |
parent | ea5a39cadb0f8acf8a95f26b6d9392a9115d4818 (diff) | |
download | sonarqube-7efdaa4a6e4f2ce8cbcc024e74407ccb13a413d3.tar.gz sonarqube-7efdaa4a6e4f2ce8cbcc024e74407ccb13a413d3.zip |
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api/src/main/java')
3 files changed, 8 insertions, 8 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java index 0666e7260f1..42eca231134 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/notifications/Notification.java @@ -121,8 +121,8 @@ public class Notification implements Serializable { } @Override - public boolean equals(Object obj) { - if (!(obj instanceof Notification)) { + public boolean equals(@Nullable Object obj) { + if (obj == null || this.getClass() != obj.getClass()) { return false; } if (this == obj) { diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java index 683f52cde43..7f83179429f 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java @@ -104,12 +104,12 @@ public class ActiveRuleParam implements Cloneable { @Override public boolean equals(Object obj) { - if (!(obj instanceof ActiveRuleParam)) { - return false; - } if (this == obj) { return true; } + if (this.getClass() != obj.getClass()) { + return false; + } ActiveRuleParam other = (ActiveRuleParam) obj; return other.getKey().equals(getKey()); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java index d9ac5cb7813..1445f50883d 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/debt/internal/DefaultDebtRemediationFunction.java @@ -101,12 +101,12 @@ public class DefaultDebtRemediationFunction implements DebtRemediationFunction { @Override public boolean equals(Object o) { - if (!(o instanceof DefaultDebtRemediationFunction)) { - return false; - } if (this == o) { return true; } + if (this.getClass() != o.getClass()) { + return false; + } DefaultDebtRemediationFunction other = (DefaultDebtRemediationFunction) o; return new EqualsBuilder() .append(coefficient, other.coefficient()) |