aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2018-08-17 09:41:21 +0200
committerSonarTech <sonartech@sonarsource.com>2018-08-21 20:21:05 +0200
commit77d6ef37a5bbae4621767025029b36bcc7db1532 (patch)
treece29b243e53920517aa02b1ff3638fead1113b4b /sonar-core
parent9e0cbc111e2575e13b0b0cda3018432b1c95a10b (diff)
downloadsonarqube-77d6ef37a5bbae4621767025029b36bcc7db1532.tar.gz
sonarqube-77d6ef37a5bbae4621767025029b36bcc7db1532.zip
SONAR-8368 fix quality flaws in AbstractTracker inner classes
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/tracking/AbstractTracker.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/tracking/AbstractTracker.java b/sonar-core/src/main/java/org/sonar/core/issue/tracking/AbstractTracker.java
index feb29d55599..406edb821b4 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/tracking/AbstractTracker.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/tracking/AbstractTracker.java
@@ -113,10 +113,13 @@ public class AbstractTracker<RAW extends Trackable, BASE extends Trackable> {
}
@Override
- public boolean equals(@Nonnull Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
LineAndLineHashAndMessage that = (LineAndLineHashAndMessage) o;
// start with most discriminant field
return Objects.equals(line, that.line)
@@ -143,10 +146,13 @@ public class AbstractTracker<RAW extends Trackable, BASE extends Trackable> {
}
@Override
- public boolean equals(@Nonnull Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
LineHashAndMessageKey that = (LineHashAndMessageKey) o;
// start with most discriminant field
return lineHash.equals(that.lineHash)
@@ -172,10 +178,13 @@ public class AbstractTracker<RAW extends Trackable, BASE extends Trackable> {
}
@Override
- public boolean equals(@Nonnull Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
LineAndMessageKey that = (LineAndMessageKey) o;
// start with most discriminant field
return Objects.equals(line, that.line)
@@ -199,10 +208,13 @@ public class AbstractTracker<RAW extends Trackable, BASE extends Trackable> {
}
@Override
- public boolean equals(@Nonnull Object o) {
+ public boolean equals(Object o) {
if (this == o) {
return true;
}
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
LineHashKey that = (LineHashKey) o;
// start with most discriminant field
return lineHash.equals(that.lineHash)