Utilize StandardCharsets
Closes gh-10972
This commit is contained in:
committed by
Stephane Nicoll
parent
e9c81bf702
commit
bd0dcfb172
@@ -22,7 +22,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
@@ -54,8 +54,6 @@ public class RestartClassLoaderTests {
|
||||
|
||||
private static final String PACKAGE_PATH = PACKAGE.replace('.', '/');
|
||||
|
||||
private static final Charset UTF_8 = Charset.forName("UTF-8");
|
||||
|
||||
@Rule
|
||||
public ExpectedException thrown = ExpectedException.none();
|
||||
|
||||
@@ -89,7 +87,7 @@ public class RestartClassLoaderTests {
|
||||
StreamUtils.copy(getClass().getResourceAsStream("Sample.class"), jarOutputStream);
|
||||
jarOutputStream.closeEntry();
|
||||
jarOutputStream.putNextEntry(new ZipEntry(PACKAGE_PATH + "/Sample.txt"));
|
||||
StreamUtils.copy("fromchild", UTF_8, jarOutputStream);
|
||||
StreamUtils.copy("fromchild", StandardCharsets.UTF_8, jarOutputStream);
|
||||
jarOutputStream.closeEntry();
|
||||
jarOutputStream.close();
|
||||
return file;
|
||||
|
||||
Reference in New Issue
Block a user