diff options
Diffstat (limited to 'sonar-duplications/src/main/java/org/sonar/duplications/index/ClonePart.java')
-rw-r--r-- | sonar-duplications/src/main/java/org/sonar/duplications/index/ClonePart.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/index/ClonePart.java b/sonar-duplications/src/main/java/org/sonar/duplications/index/ClonePart.java index 630f52c1350..0130f167197 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/index/ClonePart.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/index/ClonePart.java @@ -21,6 +21,8 @@ package org.sonar.duplications.index; import org.sonar.duplications.CodeFragment; +import javax.annotation.Nullable; + public class ClonePart implements CodeFragment { private final String resourceId; @@ -63,8 +65,8 @@ public class ClonePart implements CodeFragment { } @Override - public boolean equals(Object obj) { - if (this.getClass() == obj.getClass()) { + public boolean equals(@Nullable Object obj) { + if (obj != null && this.getClass() == obj.getClass()) { ClonePart another = (ClonePart) obj; return another.resourceId.equals(resourceId) && another.startLine == startLine |