From: Julien HENRY Date: Mon, 22 Aug 2016 10:30:44 +0000 (+0200) Subject: Fix some quality flaws X-Git-Tag: 6.1-RC1~338 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1158%2Fhead;p=sonarqube.git Fix some quality flaws --- diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/report/JSONReport.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/report/JSONReport.java index 1661d591a0d..05cc7f08717 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/report/JSONReport.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/report/JSONReport.java @@ -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); }