aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java4
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithm.java1
2 files changed, 3 insertions, 2 deletions
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java
index a2dfd55cd7a..14056dd47c3 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java
+++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java
@@ -33,7 +33,7 @@ import org.sonar.api.utils.SonarException;
import org.sonar.batch.index.ResourcePersister;
import org.sonar.duplications.block.Block;
import org.sonar.duplications.block.BlockChunker;
-import org.sonar.duplications.detector.original.OriginalCloneDetectionAlgorithm;
+import org.sonar.duplications.detector.suffixtree.SuffixTreeCloneDetectionAlgorithm;
import org.sonar.duplications.index.CloneGroup;
import org.sonar.duplications.index.CloneIndex;
import org.sonar.duplications.index.ClonePart;
@@ -185,7 +185,7 @@ public class SonarEngine extends CpdEngine {
}
public List<CloneGroup> call() {
- return OriginalCloneDetectionAlgorithm.detect(index, fileBlocks);
+ return SuffixTreeCloneDetectionAlgorithm.detect(index, fileBlocks);
}
}
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 0bd13a88cbf..004074cfa48 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
@@ -77,6 +77,7 @@ public final class SuffixTreeCloneDetectionAlgorithm {
}
GeneralisedHashText text = new GeneralisedHashText();
+ // TODO Godin: maybe we can reduce size of tree and so memory consumption by removing non-repeatable blocks
List<Block> sortedFileBlocks = Lists.newArrayList(fileBlocks);
Collections.sort(sortedFileBlocks, BLOCK_COMPARATOR);
text.addAll(sortedFileBlocks);