aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
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)