diff options
Diffstat (limited to 'org.eclipse.jgit.pgm')
5 files changed, 13 insertions, 11 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java index 2b0e5a717d..dbdccc10e2 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java @@ -43,7 +43,7 @@ package org.eclipse.jgit.pgm; -import static org.eclipse.jgit.lib.Constants.CHARSET; +import static java.nio.charset.StandardCharsets.UTF_8; import java.io.BufferedReader; import java.io.IOException; @@ -148,7 +148,7 @@ public class CommandCatalog { private void scan(URL cUrl) { try (BufferedReader cIn = new BufferedReader( - new InputStreamReader(cUrl.openStream(), CHARSET))) { + new InputStreamReader(cUrl.openStream(), UTF_8))) { String line; while ((line = cIn.readLine()) != null) { if (line.length() > 0 && !line.startsWith("#")) //$NON-NLS-1$ diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java index 6fa92d3b0b..5ed286baa9 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java @@ -44,7 +44,7 @@ package org.eclipse.jgit.pgm; -import static org.eclipse.jgit.lib.Constants.CHARSET; +import static java.nio.charset.StandardCharsets.UTF_8; import java.io.File; import java.io.IOException; @@ -227,7 +227,7 @@ public class Main { } PrintWriter createErrorWriter() { - return new PrintWriter(new OutputStreamWriter(System.err, CHARSET)); + return new PrintWriter(new OutputStreamWriter(System.err, UTF_8)); } private void execute(String[] argv) throws Exception { diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java index 575a122158..248eaac8ad 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/BenchmarkReftable.java @@ -43,7 +43,7 @@ package org.eclipse.jgit.pgm.debug; -import static org.eclipse.jgit.lib.Constants.CHARSET; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.eclipse.jgit.lib.Constants.HEAD; import static org.eclipse.jgit.lib.Constants.MASTER; import static org.eclipse.jgit.lib.Constants.R_HEADS; @@ -154,7 +154,7 @@ class BenchmarkReftable extends TextBuiltin { throws IOException, FileNotFoundException { RefList.Builder<Ref> list = new RefList.Builder<>(); try (BufferedReader br = new BufferedReader(new InputStreamReader( - new FileInputStream(lsRemotePath), CHARSET))) { + new FileInputStream(lsRemotePath), UTF_8))) { Ref last = null; String line; while ((line = br.readLine()) != null) { diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java index 2d16fefa71..8948c27537 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/RebuildCommitGraph.java @@ -43,6 +43,8 @@ package org.eclipse.jgit.pgm.debug; +import static java.nio.charset.StandardCharsets.UTF_8; + import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -141,7 +143,7 @@ class RebuildCommitGraph extends TextBuiltin { try (RevWalk rw = new RevWalk(db); final BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream(graph), - Constants.CHARSET))) { + UTF_8))) { String line; while ((line = br.readLine()) != null) { final String[] parts = line.split("[ \t]{1,}"); //$NON-NLS-1$ @@ -280,7 +282,7 @@ class RebuildCommitGraph extends TextBuiltin { try (RevWalk rw = new RevWalk(db); BufferedReader br = new BufferedReader( new InputStreamReader(new FileInputStream(refList), - Constants.CHARSET))) { + UTF_8))) { String line; while ((line = br.readLine()) != null) { final String[] parts = line.split("[ \t]{1,}"); //$NON-NLS-1$ diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java index c5ea028be8..6cbc1b082b 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/WriteReftable.java @@ -43,7 +43,7 @@ package org.eclipse.jgit.pgm.debug; -import static org.eclipse.jgit.lib.Constants.CHARSET; +import static java.nio.charset.StandardCharsets.UTF_8; import static org.eclipse.jgit.lib.Constants.HEAD; import static org.eclipse.jgit.lib.Constants.MASTER; import static org.eclipse.jgit.lib.Constants.R_HEADS; @@ -192,7 +192,7 @@ class WriteReftable extends TextBuiltin { static List<Ref> readRefs(String inputFile) throws IOException { List<Ref> refs = new ArrayList<>(); try (BufferedReader br = new BufferedReader( - new InputStreamReader(new FileInputStream(inputFile), CHARSET))) { + new InputStreamReader(new FileInputStream(inputFile), UTF_8))) { String line; while ((line = br.readLine()) != null) { ObjectId id = ObjectId.fromString(line.substring(0, 40)); @@ -227,7 +227,7 @@ class WriteReftable extends TextBuiltin { List<LogEntry> log = new ArrayList<>(); try (BufferedReader br = new BufferedReader( - new InputStreamReader(new FileInputStream(logPath), CHARSET))) { + new InputStreamReader(new FileInputStream(logPath), UTF_8))) { @SuppressWarnings("nls") Pattern pattern = Pattern.compile("([^,]+)" // 1: ref + ",([0-9]+(?:[.][0-9]+)?)" // 2: time |