]> source.dussan.org Git - jgit.git/commitdiff
Use CHARSET in FileOutputStream instead of hard-coded "UTF-8" 87/119287/4
authorDavid Pursehouse <david.pursehouse@gmail.com>
Tue, 13 Mar 2018 05:21:29 +0000 (14:21 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 13 Mar 2018 21:21:35 +0000 (22:21 +0100)
Change-Id: I63ad25e1ebd94081c8848f4d21044cf9041f971d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java

index 77cb726f1e62c98d542f66a29bd4e95cf124b252..76404aba91541a0baf203e7ca8f349f4365d1c6c 100644 (file)
@@ -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);
                }
        }
index d604751fefd635d8b84c9d7334f6593736ab0963..886f577d98d7928720d77c2f5c7ae1701d971d94 100644 (file)
@@ -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());