aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2022-08-08 16:00:48 +0200
committerHan-Wen Nienhuys <hanwen@google.com>2022-08-08 16:00:54 +0200
commitf0524d59f72fea84dfd242ee7d54ec2bbc2acab8 (patch)
treebc44789bc52bb47fedb6079690682ae5efe4b378
parent5709317f71ccaf26eceaa896150f203879b634b8 (diff)
downloadjgit-f0524d59f72fea84dfd242ee7d54ec2bbc2acab8.tar.gz
jgit-f0524d59f72fea84dfd242ee7d54ec2bbc2acab8.zip
Provide encoding to String#getBytes()
Fixes ErrorProne complaint. Change-Id: I706b225f98187bf5f86999ed5342d0072e57e314
-rw-r--r--org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ToolTestCase.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ToolTestCase.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ToolTestCase.java
index 5f6b38c25d..55db1a12d9 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ToolTestCase.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ToolTestCase.java
@@ -9,6 +9,7 @@
*/
package org.eclipse.jgit.pgm;
+import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -213,7 +214,7 @@ public abstract class ToolTestCase extends CLIRepositoryTestCase {
protected static InputStream createInputStream(List<String> inputLines) {
String input = String.join(System.lineSeparator(), inputLines);
- InputStream inputStream = new ByteArrayInputStream(input.getBytes());
+ InputStream inputStream = new ByteArrayInputStream(input.getBytes(UTF_8));
return inputStream;
}