aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-cpd-plugin
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2012-02-03 15:51:21 +0400
committerEvgeny Mandrikov <mandrikov@gmail.com>2012-02-03 15:52:29 +0400
commit12552a94eebf5bf80fb6fb3952a9b363d568397e (patch)
tree1b8f52e40e08a360231356740bb7eb879e678ae8 /plugins/sonar-cpd-plugin
parent9b3e2cc9103c5c0e7cdd4566e455e56b9d73b303 (diff)
downloadsonarqube-12552a94eebf5bf80fb6fb3952a9b363d568397e.tar.gz
sonarqube-12552a94eebf5bf80fb6fb3952a9b363d568397e.zip
Fix some quality flaws
Diffstat (limited to 'plugins/sonar-cpd-plugin')
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java
index 600c3d3de35..bfd83db3491 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java
+++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java
@@ -73,7 +73,12 @@ public class DbDuplicationsIndex {
int endLine = unit.getEndLine();
// TODO Godin: in fact we could work directly with id instead of key - this will allow to decrease memory consumption
- Block block = new Block(resourceKey, new ByteArray(hash), indexInFile, startLine, endLine);
+ Block block = Block.builder()
+ .setResourceId(resourceKey)
+ .setBlockHash(new ByteArray(hash))
+ .setIndexInFile(indexInFile)
+ .setLines(startLine, endLine)
+ .build();
// Group blocks by hash
Collection<Block> sameHash = cache.get(block.getBlockHash());