summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/exttst
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.test/exttst')
-rw-r--r--org.eclipse.jgit.test/exttst/org/eclipse/jgit/ignore/CGitVsJGitRandomIgnorePatternTest.java11
-rw-r--r--org.eclipse.jgit.test/exttst/org/eclipse/jgit/patch/EGitPatchHistoryTest.java3
2 files changed, 7 insertions, 7 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 e5a80aeefa..03b34acc05 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,13 +42,14 @@
*/
package org.eclipse.jgit.ignore;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
import java.nio.file.Files;
import java.nio.file.StandardOpenOption;
import java.util.Arrays;
@@ -153,13 +154,11 @@ public class CGitVsJGitRandomIgnorePatternTest {
private String pattern;
- public CGitIgnoreRule(File gitDir, String pattern)
- throws UnsupportedEncodingException, IOException {
+ public CGitIgnoreRule(File gitDir, String pattern) throws IOException {
this.gitDir = gitDir;
this.pattern = pattern;
Files.write(FileUtils.toPath(new File(gitDir, ".gitignore")),
- (pattern + "\n").getBytes("UTF-8"),
- StandardOpenOption.CREATE,
+ (pattern + "\n").getBytes(UTF_8), StandardOpenOption.CREATE,
StandardOpenOption.TRUNCATE_EXISTING,
StandardOpenOption.WRITE);
}
@@ -189,7 +188,7 @@ public class CGitVsJGitRandomIgnorePatternTest {
Process proc = Runtime.getRuntime().exec(command, new String[0],
gitDir);
OutputStream out = proc.getOutputStream();
- out.write((path + "\n").getBytes("UTF-8"));
+ out.write((path + "\n").getBytes(UTF_8));
out.flush();
out.close();
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 7c0ea44c35..586505cfe8 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
@@ -43,6 +43,7 @@
package org.eclipse.jgit.patch;
+import static java.nio.charset.StandardCharsets.ISO_8859_1;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -218,7 +219,7 @@ public class EGitPatchHistoryTest {
commitId = line.substring("commit ".length());
buf = new TemporaryBuffer.LocalFile(null);
} else if (buf != null) {
- buf.write(line.getBytes("ISO-8859-1"));
+ buf.write(line.getBytes(ISO_8859_1));
buf.write('\n');
}
}