diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-03-02 16:00:47 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-03-02 16:22:43 +0400 |
commit | fccfe2fab5ff9c8c0886e05dd0c7f4c8aabb27c8 (patch) | |
tree | e5b15e235fc19727a5124f331155ad28af00334b /sonar-duplications/src | |
parent | 33b92834463e73d97376c8f159ed357f953d5642 (diff) | |
download | sonarqube-fccfe2fab5ff9c8c0886e05dd0c7f4c8aabb27c8.tar.gz sonarqube-fccfe2fab5ff9c8c0886e05dd0c7f4c8aabb27c8.zip |
Minimum number of lines for duplication should depend on language
Diffstat (limited to 'sonar-duplications/src')
3 files changed, 4 insertions, 6 deletions
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/TokenizerBridge.java b/sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/TokenizerBridge.java index 57e84688d76..7881ee60cfd 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/TokenizerBridge.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/TokenizerBridge.java @@ -37,16 +37,14 @@ import java.util.List; */ public class TokenizerBridge { - private static final int BLOCK_SIZE = 10; - private final Tokenizer tokenizer; private final String encoding; private final PmdBlockChunker blockBuilder; - public TokenizerBridge(Tokenizer tokenizer, String encoding) { + public TokenizerBridge(Tokenizer tokenizer, String encoding, int blockSize) { this.tokenizer = tokenizer; this.encoding = encoding; - this.blockBuilder = new PmdBlockChunker(BLOCK_SIZE); + this.blockBuilder = new PmdBlockChunker(blockSize); } // TODO remove from here diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/PmdBridgeTest.java b/sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/PmdBridgeTest.java index 60c22a51f85..54210b9c237 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/PmdBridgeTest.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/PmdBridgeTest.java @@ -44,7 +44,7 @@ public class PmdBridgeTest { @Before public void setUp() { index = new PackedMemoryCloneIndex(); - bridge = new TokenizerBridge(new JavaTokenizer(), "UTF-8"); + bridge = new TokenizerBridge(new JavaTokenizer(), "UTF-8", 10); } @Test diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/TokenizerBridgeTest.java b/sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/TokenizerBridgeTest.java index ec2bd5d0d9b..41a78275377 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/TokenizerBridgeTest.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/internal/pmd/TokenizerBridgeTest.java @@ -49,7 +49,7 @@ public class TokenizerBridgeTest { tokenEntries.add(TokenEntry.getEOF()); } }; - bridge = new TokenizerBridge(tokenizer, "UTF-8"); + bridge = new TokenizerBridge(tokenizer, "UTF-8", 10); } @Test |