aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-09-25 14:42:12 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-09-26 08:31:13 +0900
commit2f1350c9ac51f421e5642915716f43e732c4eb14 (patch)
tree0df09945624b113a36751490072e71815efe7494 /org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io
parenta7d3fa3064a9c4a7d380415774b2c31ead5672f2 (diff)
downloadjgit-2f1350c9ac51f421e5642915716f43e732c4eb14.tar.gz
jgit-2f1350c9ac51f421e5642915716f43e732c4eb14.zip
Explicitly specify charset when calling getBytes
Change-Id: Ie492406005be56ccaf4dfb385ae376636404816d Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFInputStreamTest.java6
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFOutputStreamTest.java6
2 files changed, 8 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFInputStreamTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFInputStreamTest.java
index 1272e16173..8f77c55af2 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFInputStreamTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFInputStreamTest.java
@@ -43,6 +43,8 @@
package org.eclipse.jgit.util.io;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -89,8 +91,8 @@ public class AutoCRLFInputStreamTest {
private void assertNoCrLfHelper(String expect, String input)
throws IOException {
- byte[] inbytes = input.getBytes();
- byte[] expectBytes = expect.getBytes();
+ byte[] inbytes = input.getBytes(UTF_8);
+ byte[] expectBytes = expect.getBytes(UTF_8);
for (int i = 0; i < 5; ++i) {
byte[] buf = new byte[i];
try (ByteArrayInputStream bis = new ByteArrayInputStream(inbytes);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFOutputStreamTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFOutputStreamTest.java
index 0655827310..3a3dc8117f 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFOutputStreamTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/AutoCRLFOutputStreamTest.java
@@ -44,6 +44,8 @@
package org.eclipse.jgit.util.io;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -91,8 +93,8 @@ public class AutoCRLFOutputStreamTest {
private void assertNoCrLfHelper(String expect, String input)
throws IOException {
- byte[] inbytes = input.getBytes();
- byte[] expectBytes = expect.getBytes();
+ byte[] inbytes = input.getBytes(UTF_8);
+ byte[] expectBytes = expect.getBytes(UTF_8);
for (int i = -4; i < 5; ++i) {
int size = Math.abs(i);
byte[] buf = new byte[size];