diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-11-19 16:19:35 +0100 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-11-20 14:27:53 +0100 |
commit | 40de2916d07f4a7be0632255c25e8deacefed473 (patch) | |
tree | 2873e8c4de50243b244a8912dffde0f4e9c8f609 /sonar-batch/src | |
parent | ffbf06564219421bae3580215fff40cfe65adfc5 (diff) | |
download | sonarqube-40de2916d07f4a7be0632255c25e8deacefed473.tar.gz sonarqube-40de2916d07f4a7be0632255c25e8deacefed473.zip |
SONAR-6295 Fix blame progress report
Diffstat (limited to 'sonar-batch/src')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java | 4 | ||||
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/scm/ScmSensor.java | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java b/sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java index cf7c526d5c3..24e1783e97b 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scm/DefaultBlameOutput.java @@ -95,7 +95,7 @@ class DefaultBlameOutput implements BlameOutput { writer.writeComponentChangesets(scmBuilder.build()); allFilesToBlame.remove(file); count++; - progressReport.message(count + "/" + total + " files analyzed, last one was " + file.absolutePath()); + progressReport.message(count + "/" + total + " files analyzed"); } private static void validateLine(BlameLine line) { @@ -131,7 +131,7 @@ class DefaultBlameOutput implements BlameOutput { private static String removeNonAsciiCharacters(String inputString) { return NON_ASCII_CHARS.matcher(inputString).replaceAll("_"); } - + public void finish() { progressReport.stop(count + "/" + total + " files analyzed"); if (!allFilesToBlame.isEmpty()) { diff --git a/sonar-batch/src/main/java/org/sonar/batch/scm/ScmSensor.java b/sonar-batch/src/main/java/org/sonar/batch/scm/ScmSensor.java index b7d58cb14fa..89043201b7c 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scm/ScmSensor.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scm/ScmSensor.java @@ -80,8 +80,11 @@ public final class ScmSensor implements Sensor { String key = configuration.provider().key(); LOG.info("SCM provider for this project is: " + key); DefaultBlameOutput output = new DefaultBlameOutput(publishReportJob.getWriter(), resourceCache, filesToBlame); - configuration.provider().blameCommand().blame(new DefaultBlameInput(fs, filesToBlame), output); - output.finish(); + try { + configuration.provider().blameCommand().blame(new DefaultBlameInput(fs, filesToBlame), output); + } finally { + output.finish(); + } } } |