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.lfs | |
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.lfs')
3 files changed, 10 insertions, 10 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 4f959409fc..0e3830c098 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 org.eclipse.jgit.lib.Constants.CHARSET; +import static java.nio.charset.StandardCharsets.UTF_8; 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, - CHARSET.name())) { + UTF_8.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(CHARSET.name()); + throw new UnsupportedCharsetException(UTF_8.name()); } } @@ -165,7 +165,7 @@ public class LfsPointer implements Comparable<LfsPointer> { long sz = -1; try (BufferedReader br = new BufferedReader( - new InputStreamReader(in, CHARSET))) { + new InputStreamReader(in, UTF_8))) { 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 4da3a74f2f..3e6a26159b 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 org.eclipse.jgit.lib.Constants.CHARSET; +import static java.nio.charset.StandardCharsets.UTF_8; 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; @@ -208,7 +208,7 @@ public class LfsPrePushHook extends PrePushHook { } Gson gson = Protocol.gson(); api.getOutputStream().write( - gson.toJson(toRequest(OPERATION_UPLOAD, res)).getBytes(CHARSET)); + gson.toJson(toRequest(OPERATION_UPLOAD, res)).getBytes(UTF_8)); int responseCode = api.getResponseCode(); if (responseCode != HTTP_OK) { throw new IOException( @@ -221,7 +221,7 @@ public class LfsPrePushHook extends PrePushHook { private void uploadContents(HttpConnection api, Map<String, LfsPointer> oid2ptr) throws IOException { try (JsonReader reader = new JsonReader( - new InputStreamReader(api.getInputStream(), CHARSET))) { + new InputStreamReader(api.getInputStream(), UTF_8))) { for (Protocol.ObjectInfo o : parseObjects(reader)) { if (o.actions == null) { continue; 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 6a758cfd44..fac87c177e 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,7 +42,7 @@ */ package org.eclipse.jgit.lfs; -import static org.eclipse.jgit.lib.Constants.CHARSET; +import static java.nio.charset.StandardCharsets.UTF_8; import java.io.IOException; import java.io.InputStream; @@ -170,7 +170,7 @@ public class SmudgeFilter extends FilterCommand { .write(gson .toJson(LfsConnectionFactory .toRequest(Protocol.OPERATION_DOWNLOAD, res)) - .getBytes(CHARSET)); + .getBytes(UTF_8)); int responseCode = lfsServerConn.getResponseCode(); if (responseCode != HttpConnection.HTTP_OK) { throw new IOException( @@ -180,7 +180,7 @@ public class SmudgeFilter extends FilterCommand { } try (JsonReader reader = new JsonReader( new InputStreamReader(lfsServerConn.getInputStream(), - CHARSET))) { + UTF_8))) { Protocol.Response resp = gson.fromJson(reader, Protocol.Response.class); for (Protocol.ObjectInfo o : resp.objects) { |