From 3589c5cd1c0dc2b68880aa70728ff65566ad78da Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Tue, 4 Apr 2023 16:49:30 -0700 Subject: [PATCH] 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 Change-Id: Id7721cc5b7ea650e77c2db47042715487983cae6 --- .../tst/org/eclipse/jgit/patch/PatchApplierTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchApplierTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchApplierTest.java index eeec149871..e2637257c5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchApplierTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/patch/PatchApplierTest.java @@ -378,7 +378,7 @@ public class PatchApplierTest { @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 class PatchApplierTest { @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(); -- 2.39.5