diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-08-29 13:49:35 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-02 01:44:36 -0500 |
commit | a3cb474c94cb8a75b6dfc13ad36cd855ae969852 (patch) | |
tree | 28de4807d06550202a4d10c9a5253fb9fdea77a1 /org.eclipse.jgit.lfs/src | |
parent | c9e4359c7c87f3a5245bb7a6394192c7a2dea3b2 (diff) | |
download | jgit-a3cb474c94cb8a75b6dfc13ad36cd855ae969852.tar.gz jgit-a3cb474c94cb8a75b6dfc13ad36cd855ae969852.zip |
Specify charset when constructing InputStreamReader
ErrorProne warns [1] about implicit use of the platform default charset,
which can result in differing behaviour between JVM executions or
incorrect behavior if the encoding of the data source doesn't match
expectations.
[1] http://errorprone.info/bugpattern/DefaultCharset
Change-Id: I0fd489d352170339c3867355cd24324dfdbd4b59
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.lfs/src')
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPrePushHook.java | 2 | ||||
-rw-r--r-- | org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java | 3 |
2 files changed, 3 insertions, 2 deletions
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 a20c1d96fe..4da3a74f2f 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 @@ -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()))) { + new InputStreamReader(api.getInputStream(), CHARSET))) { 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 6bff12f9cc..6a758cfd44 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 @@ -179,7 +179,8 @@ public class SmudgeFilter extends FilterCommand { Integer.valueOf(responseCode))); } try (JsonReader reader = new JsonReader( - new InputStreamReader(lfsServerConn.getInputStream()))) { + new InputStreamReader(lfsServerConn.getInputStream(), + CHARSET))) { Protocol.Response resp = gson.fromJson(reader, Protocol.Response.class); for (Protocol.ObjectInfo o : resp.objects) { |