diff options
Diffstat (limited to 'plugins/sonar-cpd-plugin')
-rw-r--r-- | plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java | 7 |
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()); |