summaryrefslogtreecommitdiffstats
path: root/plugins/sonar-cpd-plugin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sonar-cpd-plugin')
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/SonarEngine.java4
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/index/DbDuplicationsIndex.java12
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);
}