diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-05-15 13:54:44 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-05-15 13:54:54 +0200 |
commit | b1e62699ff74c09b2cf7313ef8a33d5ea7b0ae5f (patch) | |
tree | 21efd2dbbd3492a6f518fcd57de4888e1bfb4c3b /sonar-testing-harness/src | |
parent | 6a19a67a23a39848c28ae3cf2d189bf926fadf9b (diff) | |
download | sonarqube-b1e62699ff74c09b2cf7313ef8a33d5ea7b0ae5f.tar.gz sonarqube-b1e62699ff74c09b2cf7313ef8a33d5ea7b0ae5f.zip |
Use StandardCharsets instead of Guava and commons-io
Diffstat (limited to 'sonar-testing-harness/src')
-rw-r--r-- | sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java | 4 | ||||
-rw-r--r-- | sonar-testing-harness/src/main/java/org/sonar/test/i18n/BundleSynchronizedMatcher.java | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java b/sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java index 2632d9e2504..9e6cc013149 100644 --- a/sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java +++ b/sonar-testing-harness/src/main/java/org/sonar/test/JsonAssert.java @@ -22,12 +22,12 @@ package org.sonar.test; import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonParser; -import org.apache.commons.io.Charsets; import org.apache.commons.io.IOUtils; import org.junit.ComparisonFailure; import java.io.IOException; import java.net.URL; +import java.nio.charset.StandardCharsets; /** * Assertion to compare JSON documents. Comparison is not strict: @@ -100,7 +100,7 @@ public class JsonAssert { private static String urlToString(URL url) { try { - return IOUtils.toString(url, Charsets.UTF_8); + return IOUtils.toString(url, StandardCharsets.UTF_8); } catch (IOException e) { throw new IllegalStateException("Fail to load JSON from " + url, e); } 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 00b333144ad..2eb2430efcd 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,7 +19,6 @@ */ 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; @@ -30,6 +29,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; +import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.Properties; import java.util.SortedMap; @@ -121,7 +121,7 @@ public class BundleSynchronizedMatcher extends BaseMatcher<String> { dumpFile.delete(); } dumpFile.getParentFile().mkdirs(); - try (Writer writer = new OutputStreamWriter(new FileOutputStream(dumpFile), Charsets.UTF_8)) { + try (Writer writer = new OutputStreamWriter(new FileOutputStream(dumpFile), StandardCharsets.UTF_8)) { writer.write(details); } catch (IOException e) { throw new IllegalStateException("Unable to write the report to 'target/l10n/" + bundleName + ".report.txt'", e); |