From: Matthias Sohn Date: Wed, 12 Jan 2022 01:02:35 +0000 (+0100) Subject: [errorprone] Fix implicit use of default charset in FileBasedConfigTest X-Git-Tag: v6.1.0.202202221755-m3~71^2^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F73%2F189573%2F2;p=jgit.git [errorprone] Fix implicit use of default charset in FileBasedConfigTest Change-Id: I83332efc498a5bce242915a1eec2346e6e1f58fd --- 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();