diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-01-26 21:52:24 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-01-26 23:16:14 +0400 |
commit | a0c122748fbacf4a3a57b52206c2f1692380dc69 (patch) | |
tree | bd3c6b8b25d72ee45a2e8cf803a4b5aa9aac51ab /plugins/sonar-cpd-plugin | |
parent | 14091c078d2ca1793e5186ef4dd7b55002d1b1cd (diff) | |
download | sonarqube-a0c122748fbacf4a3a57b52206c2f1692380dc69.tar.gz sonarqube-a0c122748fbacf4a3a57b52206c2f1692380dc69.zip |
SONAR-3139 Remove deprecated code, add some comments and tests
Diffstat (limited to 'plugins/sonar-cpd-plugin')
-rw-r--r-- | plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java | 4 | ||||
-rw-r--r-- | plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java index 9ae22f814c3..d686be84438 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java @@ -176,7 +176,7 @@ public class SonarEngine extends CpdEngine { for (ClonePart part : clone.getCloneParts()) { if (part.getResourceId().equals(origin.getResourceId())) { duplicatedBlocks++; - for (int duplicatedLine = part.getLineStart(); duplicatedLine < part.getLineStart() + part.getLines(); duplicatedLine++) { + for (int duplicatedLine = part.getStartLine(); duplicatedLine < part.getEndLine() + part.getLines(); duplicatedLine++) { duplicatedLines.add(duplicatedLine); } } @@ -188,7 +188,7 @@ public class SonarEngine extends CpdEngine { for (CloneGroup clone : clones) { xml.append("<g>"); for (ClonePart part : clone.getCloneParts()) { - xml.append("<b s=\"").append(part.getLineStart()) + xml.append("<b s=\"").append(part.getStartLine()) .append("\" l=\"").append(part.getLines()) .append("\" r=\"").append(part.getResourceId()) .append("\"/>"); 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 ec231780acc..600c3d3de35 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 @@ -101,12 +101,12 @@ public class DbDuplicationsIndex { List<DuplicationUnitDto> units = Lists.newArrayList(); for (Block block : blocks) { DuplicationUnitDto unit = new DuplicationUnitDto( - currentProjectSnapshotId, - resourceSnapshotId, - block.getBlockHash().toString(), - block.getIndexInFile(), - block.getFirstLineNumber(), - block.getLastLineNumber()); + currentProjectSnapshotId, + resourceSnapshotId, + block.getBlockHash().toString(), + block.getIndexInFile(), + block.getStartLine(), + block.getEndLine()); units.add(unit); } |