Browse Source

Use CHARSET in FileOutputStream instead of hard-coded "UTF-8"

Change-Id: I63ad25e1ebd94081c8848f4d21044cf9041f971d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.0
David Pursehouse 7 years ago committed by Matthias Sohn
parent
commit
da3d76f00e
  1. 3
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java
  2. 3
      org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java

3
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/NetRCTest.java

@ -42,6 +42,7 @@
package org.eclipse.jgit.transport; package org.eclipse.jgit.transport;
import static org.eclipse.jgit.lib.Constants.CHARSET;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull; import static org.junit.Assert.assertNull;
@ -75,7 +76,7 @@ public class NetRCTest extends RepositoryTestCase {
private void config(final String data) throws IOException { private void config(final String data) throws IOException {
try (OutputStreamWriter fw = new OutputStreamWriter( try (OutputStreamWriter fw = new OutputStreamWriter(
new FileOutputStream(configFile), "UTF-8")) { new FileOutputStream(configFile), CHARSET)) {
fw.write(data); fw.write(data);
} }
} }

3
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/OpenSshConfigTest.java

@ -43,6 +43,7 @@
package org.eclipse.jgit.transport; package org.eclipse.jgit.transport;
import static org.eclipse.jgit.lib.Constants.CHARSET;
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
@ -93,7 +94,7 @@ public class OpenSshConfigTest extends RepositoryTestCase {
long lastMtime = configFile.lastModified(); long lastMtime = configFile.lastModified();
do { do {
try (final OutputStreamWriter fw = new OutputStreamWriter( try (final OutputStreamWriter fw = new OutputStreamWriter(
new FileOutputStream(configFile), "UTF-8")) { new FileOutputStream(configFile), CHARSET)) {
fw.write(data); fw.write(data);
} }
} while (lastMtime == configFile.lastModified()); } while (lastMtime == configFile.lastModified());

Loading…
Cancel
Save