diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-09-03 19:49:27 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-10-26 17:49:20 -0400 |
commit | fc6fe793ce5c17a9270de443d09e38ff2fa45a43 (patch) | |
tree | b906d394fd439afd395403b41d70922224a22f14 /org.eclipse.jgit.test | |
parent | ff3c3d8ff52eec0fff297b3ab056447599d589b2 (diff) | |
download | jgit-fc6fe793ce5c17a9270de443d09e38ff2fa45a43.tar.gz jgit-fc6fe793ce5c17a9270de443d09e38ff2fa45a43.zip |
Don't rely on an implicit default character set
JEP 400 (Java 18) will change the default character set to UTF-8
unconditionally.[1] Introduce SystemReader.getDefaultCharset() that
provides the locale-dependent charset the way JEP 400 recommends.
Change all code locations using Charset.defaultCharset() to use the
new SystemReader method instead.
[1] https://openjdk.java.net/jeps/400
Change-Id: I986f97a410d2fc70748b6f93228a2d45ff100b2c
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java index 8de7ba6c1d..171d80c3da 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FSTest.java @@ -19,7 +19,6 @@ import static org.junit.Assume.assumeTrue; import java.io.File; import java.io.IOException; -import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; @@ -182,7 +181,7 @@ public class FSTest { FS.readPipe(fs.userHome(), new String[] { "/bin/sh", "-c", "exit 1" }, - Charset.defaultCharset().name()); + SystemReader.getInstance().getDefaultCharset().name()); } @Test(expected = CommandFailedException.class) @@ -192,7 +191,7 @@ public class FSTest { FS.readPipe(fs.userHome(), new String[] { "this-command-does-not-exist" }, - Charset.defaultCharset().name()); + SystemReader.getInstance().getDefaultCharset().name()); } @Test |