PatchApplierTest: specify charset to avoid warning

Running

  bazel test //org.eclipse.jgit.test:org_eclipse_jgit_patch_PatchApplierTest

results in a DefaultCharset error on my machine, which can be avoided
by explicitly specifying a charset when calling getBytes on a string. In
these tests, the charset used doesn't really matter, so go with UTF_8.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Change-Id: Id7721cc5b7ea650e77c2db47042715487983cae6
This commit is contained in:
Jonathan Tan 2023-04-04 16:49:30 -07:00
parent 5a6e356082
commit 3589c5cd1c
1 changed files with 2 additions and 2 deletions

View File

@ -378,7 +378,7 @@ public void testShiftDown2() throws Exception {
@Test
public void testAddAlreadyExistingFile() throws Exception {
addFile("M1", "existing content".getBytes());
addFile("M1", "existing content".getBytes(StandardCharsets.UTF_8));
init("M1", false, false);
Result result = applyPatch();
@ -429,7 +429,7 @@ public void testCopyNonexistentFile() throws Exception {
@Test
public void testCopyOnTopAlreadyExistingFile() throws Exception {
addFile("CopyResult", "existing content".getBytes());
addFile("CopyResult", "existing content".getBytes(StandardCharsets.UTF_8));
init("CopyWithHunks", true, false);
Result result = applyPatch();