diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-03-08 09:44:01 +0900 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2018-03-11 22:46:52 +0100 |
commit | f07b60239c3e3bca7c75705c678dd32a12047e09 (patch) | |
tree | cb8e5e3f5b494852a334551ee03d22b5d3377988 /org.eclipse.jgit.junit | |
parent | 62bc48df60bc852f4f93a721b1599232133ad289 (diff) | |
download | jgit-f07b60239c3e3bca7c75705c678dd32a12047e09.tar.gz jgit-f07b60239c3e3bca7c75705c678dd32a12047e09.zip |
Consistently use Constants.CHARSET rather than StandardCharsets.UTF_8
Change-Id: I6714fc3666e1bced22abba94ceb700477349586e
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.junit')
4 files changed, 9 insertions, 9 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java index cef81a062d..27f745e4e9 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/JGitTestUtil.java @@ -45,7 +45,7 @@ package org.eclipse.jgit.junit; -import static java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.CHARSET; import java.io.File; import java.io.FileNotFoundException; @@ -246,7 +246,7 @@ public abstract class JGitTestUtil { throws IOException { FileUtils.mkdirs(f.getParentFile(), true); try (Writer w = new OutputStreamWriter(new FileOutputStream(f), - UTF_8)) { + CHARSET)) { w.write(body); } } @@ -263,7 +263,7 @@ public abstract class JGitTestUtil { */ public static String read(final File file) throws IOException { final byte[] body = IO.readFully(file); - return new String(body, 0, body.length, UTF_8); + return new String(body, 0, body.length, CHARSET); } /** diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index 568bc3b0e1..3c00bd3df1 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -45,7 +45,7 @@ package org.eclipse.jgit.junit; -import static java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.CHARSET; import static org.junit.Assert.assertFalse; import static org.junit.Assert.fail; @@ -352,7 +352,7 @@ public abstract class LocalDiskRepositoryTestCase { if (0 != (includedOptions & CONTENT)) { sb.append(", content:" + new String(repo.open(entry.getObjectId(), - Constants.OBJ_BLOB).getCachedBytes(), UTF_8)); + Constants.OBJ_BLOB).getCachedBytes(), CHARSET)); } if (0 != (includedOptions & ASSUME_UNCHANGED)) sb.append(", assume-unchanged:" diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java index afc2c445cf..5a83a1f492 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java @@ -46,7 +46,7 @@ package org.eclipse.jgit.junit; -import static java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.CHARSET; import static org.junit.Assert.assertEquals; import java.io.File; @@ -199,7 +199,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { protected static void checkFile(File f, final String checkData) throws IOException { try (Reader r = new InputStreamReader(new FileInputStream(f), - UTF_8)) { + CHARSET)) { if (checkData.length() > 0) { char[] data = new char[checkData.length()]; assertEquals(data.length, r.read(data)); diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java index 41634e7cda..89a86d8eea 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java @@ -43,7 +43,7 @@ package org.eclipse.jgit.junit; -import static java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.CHARSET; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; @@ -268,7 +268,7 @@ public class TestRepository<R extends Repository> { * @throws Exception */ public RevBlob blob(final String content) throws Exception { - return blob(content.getBytes(UTF_8)); + return blob(content.getBytes(CHARSET)); } /** |