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.lfs | |
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.lfs')
3 files changed, 9 insertions, 8 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java index 0e3830c098..4f959409fc 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java @@ -42,7 +42,7 @@ */ package org.eclipse.jgit.lfs; -import static java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.CHARSET; import java.io.BufferedReader; import java.io.IOException; @@ -134,7 +134,7 @@ public class LfsPointer implements Comparable<LfsPointer> { */ public void encode(OutputStream out) { try (PrintStream ps = new PrintStream(out, false, - UTF_8.name())) { + CHARSET.name())) { ps.print("version "); //$NON-NLS-1$ ps.print(VERSION + "\n"); //$NON-NLS-1$ ps.print("oid " + HASH_FUNCTION_NAME + ":"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -143,7 +143,7 @@ public class LfsPointer implements Comparable<LfsPointer> { ps.print(size + "\n"); //$NON-NLS-1$ } catch (UnsupportedEncodingException e) { // should not happen, we are using a standard charset - throw new UnsupportedCharsetException(UTF_8.name()); + throw new UnsupportedCharsetException(CHARSET.name()); } } @@ -165,7 +165,7 @@ public class LfsPointer implements Comparable<LfsPointer> { long sz = -1; try (BufferedReader br = new BufferedReader( - new InputStreamReader(in, UTF_8))) { + new InputStreamReader(in, CHARSET))) { for (String s = br.readLine(); s != null; s = br.readLine()) { if (s.startsWith("#") || s.length() == 0) { //$NON-NLS-1$ continue; diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java index c522572ee3..7fd7c216ac 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java @@ -42,7 +42,7 @@ */ package org.eclipse.jgit.lfs; -import static java.nio.charset.StandardCharsets.UTF_8; +import static org.eclipse.jgit.lib.Constants.CHARSET; import static org.eclipse.jgit.lfs.Protocol.OPERATION_UPLOAD; import static org.eclipse.jgit.lfs.internal.LfsConnectionFactory.toRequest; import static org.eclipse.jgit.transport.http.HttpConnection.HTTP_OK; @@ -204,7 +204,7 @@ public class LfsPrePushHook extends PrePushHook { } Gson gson = Protocol.gson(); api.getOutputStream().write( - gson.toJson(toRequest(OPERATION_UPLOAD, res)).getBytes(UTF_8)); + gson.toJson(toRequest(OPERATION_UPLOAD, res)).getBytes(CHARSET)); int responseCode = api.getResponseCode(); if (responseCode != HTTP_OK) { throw new IOException( diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java index e2ab309230..6bff12f9cc 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java @@ -42,11 +42,12 @@ */ package org.eclipse.jgit.lfs; +import static org.eclipse.jgit.lib.Constants.CHARSET; + import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.text.MessageFormat; @@ -169,7 +170,7 @@ public class SmudgeFilter extends FilterCommand { .write(gson .toJson(LfsConnectionFactory .toRequest(Protocol.OPERATION_DOWNLOAD, res)) - .getBytes(StandardCharsets.UTF_8)); + .getBytes(CHARSET)); int responseCode = lfsServerConn.getResponseCode(); if (responseCode != HttpConnection.HTTP_OK) { throw new IOException( |