From dacd73d365b9e144ecf9259dd17e3a8dc9072fe3 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 6 Jan 2015 10:33:20 +0100 Subject: Fix quality flaws --- .../main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java') diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java b/sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java index 6e6737c4045..fdb16924b63 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java @@ -19,14 +19,19 @@ */ package org.sonar.test.i18n; +import org.apache.commons.io.Charsets; import org.apache.commons.io.IOUtils; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; +import java.io.BufferedWriter; import java.io.File; +import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; import java.util.Map; import java.util.Properties; import java.util.SortedMap; @@ -118,9 +123,9 @@ public class BundleSynchronizedMatcher extends BaseMatcher { dumpFile.delete(); } dumpFile.getParentFile().mkdirs(); - FileWriter writer = null; + Writer writer = null; try { - writer = new FileWriter(dumpFile); + writer = new OutputStreamWriter(new FileOutputStream(dumpFile), Charsets.UTF_8); writer.write(details); } catch (IOException e) { throw new IllegalStateException("Unable to write the report to 'target/l10n/" + bundleName + ".report.txt'", e); -- cgit v1.2.3