8234147: Avoid looking up standard charsets in core libraries

Reviewed-by: alanb
This commit is contained in:
Ivan Gerasimov 2019-12-01 15:29:37 -08:00
parent 4e64af81a2
commit cd589d8469
36 changed files with 200 additions and 237 deletions

View file

@ -46,6 +46,9 @@ import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Function;
import sun.nio.cs.ISO_8859_1;
import sun.nio.cs.UTF_8;
import jdk.internal.access.SharedSecrets;
import jdk.internal.misc.Unsafe;
import jdk.internal.util.ArraysSupport;
@ -909,7 +912,7 @@ public class Properties extends Hashtable<Object,Object> {
public void store(OutputStream out, String comments)
throws IOException
{
store0(new BufferedWriter(new OutputStreamWriter(out, "8859_1")),
store0(new BufferedWriter(new OutputStreamWriter(out, ISO_8859_1.INSTANCE)),
comments,
true);
}
@ -1001,7 +1004,7 @@ public class Properties extends Hashtable<Object,Object> {
public void storeToXML(OutputStream os, String comment)
throws IOException
{
storeToXML(os, comment, "UTF-8");
storeToXML(os, comment, UTF_8.INSTANCE);
}
/**