aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-duplications/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-18 11:10:08 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-07-18 13:15:50 +0200
commit7cdbfc9e015093f8f2c58b43a106e6b347728bcf (patch)
tree1166f01640b49d9d142f7575fb1e27f60173401b /sonar-duplications/src
parent0dff22bda049bcb3f5fa8cb0bcb5d9ea8a80fe8c (diff)
downloadsonarqube-7cdbfc9e015093f8f2c58b43a106e6b347728bcf.tar.gz
sonarqube-7cdbfc9e015093f8f2c58b43a106e6b347728bcf.zip
Fix Quality flaws
Diffstat (limited to 'sonar-duplications/src')
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java7
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithm.java12
2 files changed, 5 insertions, 14 deletions
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java
index bdc87065250..62a62e0fde3 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/Search.java
@@ -36,12 +36,7 @@ public final class Search {
private final List<Integer> list = new ArrayList<>();
private final List<Node> innerNodes = new ArrayList<>();
- private static final Comparator<Node> DEPTH_COMPARATOR = new Comparator<Node>() {
- @Override
- public int compare(Node o1, Node o2) {
- return o2.depth - o1.depth;
- }
- };
+ private static final Comparator<Node> DEPTH_COMPARATOR = (o1, o2) -> o2.depth - o1.depth;
private Search(SuffixTree tree, TextSet text, Collector reporter) {
this.tree = tree;
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithm.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithm.java
index 1d84f92df8c..c8f6ef0a533 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithm.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithm.java
@@ -35,16 +35,12 @@ import org.sonar.duplications.index.CloneIndex;
public final class SuffixTreeCloneDetectionAlgorithm {
+ private static final Comparator<Block> BLOCK_COMPARATOR = (o1, o2) -> o1.getIndexInFile() - o2.getIndexInFile();
+
private SuffixTreeCloneDetectionAlgorithm() {
+ // only statics
}
-
- private static final Comparator<Block> BLOCK_COMPARATOR = new Comparator<Block>() {
- @Override
- public int compare(Block o1, Block o2) {
- return o1.getIndexInFile() - o2.getIndexInFile();
- }
- };
-
+
public static List<CloneGroup> detect(CloneIndex cloneIndex, Collection<Block> fileBlocks) {
if (fileBlocks.isEmpty()) {
return Collections.emptyList();