aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2022-01-12 02:02:35 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2022-01-18 16:11:56 +0100
commit8b00cb9324edff469788c81c0f0423a58a8f12f1 (patch)
tree29f6e5915d576c1f6da3f2065b596ec8de11f278
parent2fed62528a598a16bb9c5cd1df861aa8ab7f820a (diff)
downloadjgit-8b00cb9324edff469788c81c0f0423a58a8f12f1.tar.gz
jgit-8b00cb9324edff469788c81c0f0423a58a8f12f1.zip
[errorprone] Fix implicit use of default charset in FileBasedConfigTest
Change-Id: I83332efc498a5bce242915a1eec2346e6e1f58fd
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
index 7f0bfefbe7..b964e97752 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/FileBasedConfigTest.java
@@ -19,6 +19,7 @@ import static org.junit.Assert.assertFalse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
@@ -276,7 +277,8 @@ public class FileBasedConfigTest {
throws IOException {
AtomicBoolean userConfigTimeRead = new AtomicBoolean(false);
- Path userConfigFile = createFile(CONTENT1.getBytes(), "home");
+ Path userConfigFile = createFile(
+ CONTENT1.getBytes(StandardCharsets.UTF_8), "home");
mockSystemReader.setUserGitConfig(
new FileBasedConfig(userConfigFile.toFile(), FS.DETECTED) {
@@ -289,7 +291,8 @@ public class FileBasedConfigTest {
}
});
- Path file = createFile(CONTENT2.getBytes(), "repo");
+ Path file = createFile(CONTENT2.getBytes(StandardCharsets.UTF_8),
+ "repo");
FileBasedConfig fileBasedConfig = new FileBasedConfig(file.toFile(),
FS.DETECTED);
fileBasedConfig.save();