diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-02-02 18:49:14 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-02-05 21:52:04 +0100 |
commit | 937824b05e114fa21af572e24e36eeeda29842ef (patch) | |
tree | 689890784c603bd8d756280e0d75916f07d031cb /sonar-scanner-engine | |
parent | 2c0f324f86c3c6b2e7eb45f363f12e0fa511541f (diff) | |
download | sonarqube-937824b05e114fa21af572e24e36eeeda29842ef.tar.gz sonarqube-937824b05e114fa21af572e24e36eeeda29842ef.zip |
Improve doc and usages of JsonWriter
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/report/JSONReport.java | 5 |
1 files changed, 2 insertions, 3 deletions
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 68c2c20f9b2..fdaaefa2e19 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 @@ -109,8 +109,7 @@ public class JSONReport implements Reporter { @VisibleForTesting void writeJson(Writer writer) { - try { - JsonWriter json = JsonWriter.of(writer); + try (JsonWriter json = JsonWriter.of(writer)) { json.beginObject(); json.prop("version", server.getVersion()); @@ -120,7 +119,7 @@ public class JSONReport implements Reporter { writeJsonComponents(json); writeJsonRules(json, ruleKeys); writeUsers(json, userLogins); - json.endObject().close(); + json.endObject(); } catch (IOException e) { throw new IllegalStateException("Unable to write JSON report", e); |