diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-04 10:53:10 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-04 10:53:10 +0900 |
commit | 30c6c7542190c149e2aee792f992a312a5fc5793 (patch) | |
tree | 12a8858313ee88ebf87a1a30840128d1a2e19a99 /org.eclipse.jgit.test/exttst/org/eclipse | |
parent | 685f8c8dbe9e2f1e139a55970588f92d5482b3ba (diff) | |
download | jgit-30c6c7542190c149e2aee792f992a312a5fc5793.tar.gz jgit-30c6c7542190c149e2aee792f992a312a5fc5793.zip |
Deprecate Constants.CHARSET in favor of StandardCharsets.UTF_8
Change-Id: I3b748620f067582afef20f144feebe40d0332be2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/exttst/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java | 6 | ||||
-rw-r--r-- | org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java index 4d9e864227..438d2d625b 100644 --- a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java +++ b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java @@ -42,7 +42,7 @@ */ package org.eclipse.jgit.ignore; -import static org.eclipse.jgit.lib.Constants.CHARSET; +import static java.nio.charset.StandardCharsets.UTF_8; import java.io.BufferedReader; import java.io.File; @@ -158,7 +158,7 @@ public class CGitVsJGitRandomIgnorePatternTest { this.gitDir = gitDir; this.pattern = pattern; Files.write(FileUtils.toPath(new File(gitDir, ".gitignore")), - (pattern + "\n").getBytes(CHARSET), StandardOpenOption.CREATE, + (pattern + "\n").getBytes(UTF_8), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE); } @@ -188,7 +188,7 @@ public class CGitVsJGitRandomIgnorePatternTest { Process proc = Runtime.getRuntime().exec(command, new String[0], gitDir); try (OutputStream out = proc.getOutputStream()) { - out.write((path + "\n").getBytes(CHARSET)); + out.write((path + "\n").getBytes(UTF_8)); out.flush(); } return proc; diff --git a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java index 79d8d0e10b..f597f2fe3c 100644 --- a/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java +++ b/org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java @@ -44,6 +44,7 @@ package org.eclipse.jgit.patch; import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -56,7 +57,6 @@ import java.io.UnsupportedEncodingException; import java.util.HashMap; import java.util.HashSet; -import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.util.MutableInteger; import org.eclipse.jgit.util.RawParseUtils; import org.eclipse.jgit.util.TemporaryBuffer; @@ -176,7 +176,7 @@ public class EGitPatchHistoryTest { i.added = RawParseUtils.parseBase10(buf, ptr.value, ptr); i.deleted = RawParseUtils.parseBase10(buf, ptr.value + 1, ptr); final int eol = RawParseUtils.nextLF(buf, ptr.value); - final String name = RawParseUtils.decode(Constants.CHARSET, + final String name = RawParseUtils.decode(UTF_8, buf, ptr.value + 1, eol - 1); files.put(name, i); ptr.value = eol; |