From 8b00cb9324edff469788c81c0f0423a58a8f12f1 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Wed, 12 Jan 2022 02:02:35 +0100 Subject: [PATCH] [errorprone] Fix implicit use of default charset in FileBasedConfigTest Change-Id: I83332efc498a5bce242915a1eec2346e6e1f58fd --- .../org/eclipse/jgit/storage/file/FileBasedConfigTest.java | 7 +++++-- 1 file 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(); -- 2.39.5