From da3d76f00ede01a976dbe1089f073a9c0f1c13a7 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Tue, 13 Mar 2018 14:21:29 +0900 Subject: [PATCH] Use CHARSET in FileOutputStream instead of hard-coded "UTF-8" Change-Id: I63ad25e1ebd94081c8848f4d21044cf9041f971d Signed-off-by: David Pursehouse --- .../tst/org/eclipse/jgit/transport/NetRCTest.java | 3 ++- .../tst/org/eclipse/jgit/transport/OpenSshConfigTest.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java index 77cb726f1e..76404aba91 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java @@ -42,6 +42,7 @@ package org.eclipse.jgit.transport; +import static org.eclipse.jgit.lib.Constants.CHARSET; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -75,7 +76,7 @@ public class NetRCTest extends RepositoryTestCase { private void config(final String data) throws IOException { try (OutputStreamWriter fw = new OutputStreamWriter( - new FileOutputStream(configFile), "UTF-8")) { + new FileOutputStream(configFile), CHARSET)) { fw.write(data); } } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java index d604751fef..886f577d98 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java @@ -43,6 +43,7 @@ package org.eclipse.jgit.transport; +import static org.eclipse.jgit.lib.Constants.CHARSET; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -93,7 +94,7 @@ public class OpenSshConfigTest extends RepositoryTestCase { long lastMtime = configFile.lastModified(); do { try (final OutputStreamWriter fw = new OutputStreamWriter( - new FileOutputStream(configFile), "UTF-8")) { + new FileOutputStream(configFile), CHARSET)) { fw.write(data); } } while (lastMtime == configFile.lastModified()); -- 2.39.5