]> source.dussan.org Git - sonarqube.git/commitdiff
Fix some quality flaws 1158/head
authorJulien HENRY <julien.henry@sonarsource.com>
Mon, 22 Aug 2016 10:30:44 +0000 (12:30 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Tue, 23 Aug 2016 07:53:20 +0000 (09:53 +0200)
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/report/JSONReport.java

index 1661d591a0dffec5c86cc95a199b78d12b0c50fa..05cc7f08717107fc3b34ba2bf5faeef9f24e81a9 100644 (file)
@@ -100,9 +100,8 @@ public class JSONReport implements Reporter {
     File exportFile = new File(fileSystem.workDir(), exportPath);
 
     LOG.info("Export issues to {}", exportFile.getAbsolutePath());
-    try (Writer output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(exportFile), StandardCharsets.UTF_8))) {
-      writeJson(output);
-
+    try (FileOutputStream fos = new FileOutputStream(exportFile)) {
+      writeJson(new BufferedWriter(new OutputStreamWriter(fos, StandardCharsets.UTF_8)));
     } catch (IOException e) {
       throw new IllegalStateException("Unable to write report results in file " + exportFile.getAbsolutePath(), e);
     }