diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-12-15 14:02:49 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2011-12-15 22:26:40 +0400 |
commit | ae5528042cd2f948cea3e50c32a5426eb302d3f7 (patch) | |
tree | 059fc62017442e0e7011b1143bda411bbc255e0d /sonar-duplications/src/test/java | |
parent | 16232e514c5b0d064a114906fb31441b97a480ae (diff) | |
download | sonarqube-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.java | 4 |
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++; |