diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-02-23 12:02:14 +0100 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-02-23 12:02:14 +0100 |
commit | cc12644634a2b5d5d2d63764f4e0f97fc3ed333d (patch) | |
tree | 0d17f4cade8972fd87381bf273a61c2c463b05c6 /sonar-duplications | |
parent | c43ee4857c97e583433997678ddaebeb7ec68722 (diff) | |
download | sonarqube-cc12644634a2b5d5d2d63764f4e0f97fc3ed333d.tar.gz sonarqube-cc12644634a2b5d5d2d63764f4e0f97fc3ed333d.zip |
Revert "Fix quality flaws"
This reverts commit 7efdaa4a6e4f2ce8cbcc024e74407ccb13a413d3.
Diffstat (limited to 'sonar-duplications')
5 files changed, 8 insertions, 7 deletions
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java index 51ecbe54294..82ab1db55a6 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/TextSet.java @@ -19,10 +19,11 @@ */ package org.sonar.duplications.detector.suffixtree; -import com.google.common.collect.Lists; +import java.util.List; + import org.sonar.duplications.block.Block; -import java.util.List; +import com.google.common.collect.Lists; /** * Simplifies construction of <a href="http://en.wikipedia.org/wiki/Generalised_suffix_tree">generalised suffix-tree</a>. @@ -91,7 +92,7 @@ public final class TextSet extends AbstractText { @Override public boolean equals(Object obj) { - return (this.getClass() == obj.getClass()) && (((Terminator) obj).stringNumber == stringNumber); + return (obj instanceof Terminator) && (((Terminator) obj).stringNumber == stringNumber); } @Override diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/index/CloneGroup.java b/sonar-duplications/src/main/java/org/sonar/duplications/index/CloneGroup.java index b840c2f55f0..01b7273da1c 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/index/CloneGroup.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/index/CloneGroup.java @@ -135,7 +135,7 @@ public class CloneGroup { */ @Override public boolean equals(Object object) { - if (this.getClass() != object.getClass()) { + if (!(object instanceof CloneGroup)) { return false; } CloneGroup another = (CloneGroup) object; 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..6a569e27eae 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 @@ -64,7 +64,7 @@ public class ClonePart implements CodeFragment { @Override public boolean equals(Object obj) { - if (this.getClass() == obj.getClass()) { + if (obj instanceof ClonePart) { ClonePart another = (ClonePart) obj; return another.resourceId.equals(resourceId) && another.startLine == startLine diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/statement/Statement.java b/sonar-duplications/src/main/java/org/sonar/duplications/statement/Statement.java index dc1c8ac402d..49e9e90f743 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/statement/Statement.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/statement/Statement.java @@ -82,7 +82,7 @@ public class Statement implements CodeFragment { @Override public boolean equals(Object obj) { - if (this.getClass() != obj.getClass()) { + if (!(obj instanceof Statement)) { return false; } Statement other = (Statement) obj; diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/token/Token.java b/sonar-duplications/src/main/java/org/sonar/duplications/token/Token.java index c1c374e7f52..06525a4ccda 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/token/Token.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/token/Token.java @@ -50,7 +50,7 @@ public class Token { @Override public boolean equals(Object object) { - if (this.getClass() == object.getClass()) { + if (object instanceof Token) { Token anotherToken = (Token) object; return anotherToken.line == line && anotherToken.column == column && anotherToken.value.equals(value); } |