summaryrefslogtreecommitdiffstats
path: root/sonar-duplications/src/test/java
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2011-12-15 14:02:49 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2011-12-15 22:26:40 +0400
commitae5528042cd2f948cea3e50c32a5426eb302d3f7 (patch)
tree059fc62017442e0e7011b1143bda411bbc255e0d /sonar-duplications/src/test/java
parent16232e514c5b0d064a114906fb31441b97a480ae (diff)
downloadsonarqube-ae5528042cd2f948cea3e50c32a5426eb302d3f7.tar.gz
sonarqube-ae5528042cd2f948cea3e50c32a5426eb302d3f7.zip
SONAR-3060 Improve new CPD algorithm
* Remove recursive part of algorithm to avoid StackOverflowError * Fix violations
Diffstat (limited to 'sonar-duplications/src/test/java')
-rw-r--r--sonar-duplications/src/test/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithmTest.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithmTest.java b/sonar-duplications/src/test/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithmTest.java
index 7d80e899859..4be45100f30 100644
--- a/sonar-duplications/src/test/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithmTest.java
+++ b/sonar-duplications/src/test/java/org/sonar/duplications/detector/suffixtree/SuffixTreeCloneDetectionAlgorithmTest.java
@@ -59,8 +59,6 @@ public class SuffixTreeCloneDetectionAlgorithmTest extends DetectorTestCase {
* However should be noted that current implementation with suffix-tree also is not optimal,
* even if it works for this example couple of seconds,
* because duplications should be filtered in order to remove fully-covered.
- * Moreover - height of the tree grows, depending on the number of blocks, which might lead to StackOverflowError,
- * because algorithm uses recursion.
* But such cases nearly never appear in real-world, so current implementation is acceptable for the moment.
* </p>
*/
@@ -69,7 +67,7 @@ public class SuffixTreeCloneDetectionAlgorithmTest extends DetectorTestCase {
CloneIndex index = createIndex();
List<Block> fileBlocks = Lists.newArrayList();
int indexInFile = 0;
- for (int i = 0; i < 2000; i++) {
+ for (int i = 0; i < 5000; i++) {
Block block = newBlock("x", new ByteArray("01"), indexInFile);
fileBlocks.add(block);
indexInFile++;