aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-testing-harness
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-01-06 10:33:20 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-01-06 11:32:02 +0100
commitdacd73d365b9e144ecf9259dd17e3a8dc9072fe3 (patch)
tree734c8cfadfcca8d1b4a704717ea92fb744a10d5c /sonar-testing-harness
parent638787991514e6e254a72dc57ae47a414b95d85a (diff)
downloadsonarqube-dacd73d365b9e144ecf9259dd17e3a8dc9072fe3.tar.gz
sonarqube-dacd73d365b9e144ecf9259dd17e3a8dc9072fe3.zip
Fix quality flaws
Diffstat (limited to 'sonar-testing-harness')
-rw-r--r--sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java9
1 files changed, 7 insertions, 2 deletions
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<String> {
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);