diff options
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/version/v50/FileSourceDto.java | 2 | ||||
-rw-r--r-- | sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v50/FileSourceDto.java b/sonar-db/src/main/java/org/sonar/db/version/v50/FileSourceDto.java index b69c0994713..d4135d069e6 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/v50/FileSourceDto.java +++ b/sonar-db/src/main/java/org/sonar/db/version/v50/FileSourceDto.java @@ -89,7 +89,7 @@ class FileSourceDto { Map<Integer, String> duplicationsPerLine = computeDuplicationsPerLine(duplicationGroups); ByteArrayOutputStream output = new ByteArrayOutputStream(); int line = 0; - String sourceLine = null; + String sourceLine; CsvWriter csv = CsvWriter.of(new OutputStreamWriter(output, UTF_8)); StringBuilder lineHashes = new StringBuilder(); while (sourceSplitter.hasNext()) { diff --git a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java index eae293c0d6f..c124d395535 100644 --- a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java +++ b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java @@ -144,7 +144,7 @@ public class SourceCode { public String getSlice(int startLine, int endLine) { StringBuffer sb = new StringBuffer(); List lines = cl.getCode(); - for (int i = (startLine == 0 ? startLine : startLine - 1); i < endLine && i < lines.size(); i++) { + for (int i = (startLine == 0 ? startLine : (startLine - 1)); i < endLine && i < lines.size(); i++) { if (sb.length() != 0) { sb.append(EOL); } |