diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-08-17 09:41:21 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-08-21 20:21:05 +0200 |
commit | 77d6ef37a5bbae4621767025029b36bcc7db1532 (patch) | |
tree | ce29b243e53920517aa02b1ff3638fead1113b4b /sonar-core | |
parent | 9e0cbc111e2575e13b0b0cda3018432b1c95a10b (diff) | |
download | sonarqube-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.java | 20 |
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) |