mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8234147: Avoid looking up standard charsets in core libraries
Reviewed-by: alanb
This commit is contained in:
parent
4e64af81a2
commit
cd589d8469
36 changed files with 200 additions and 237 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -25,6 +25,9 @@
|
|||
|
||||
package sun.util;
|
||||
|
||||
import sun.nio.cs.ISO_8859_1;
|
||||
import sun.nio.cs.UTF_8;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
|
@ -70,7 +73,7 @@ public class PropertyResourceBundleCharset extends Charset {
|
|||
|
||||
private final class PropertiesFileDecoder extends CharsetDecoder {
|
||||
|
||||
private CharsetDecoder cdUTF_8 = StandardCharsets.UTF_8.newDecoder()
|
||||
private CharsetDecoder cdUTF_8 = UTF_8.INSTANCE.newDecoder()
|
||||
.onMalformedInput(CodingErrorAction.REPORT)
|
||||
.onUnmappableCharacter(CodingErrorAction.REPORT);
|
||||
private CharsetDecoder cdISO_8859_1 = null;
|
||||
|
@ -98,7 +101,7 @@ public class PropertyResourceBundleCharset extends Charset {
|
|||
assert cr.isMalformed() || cr.isUnmappable();
|
||||
in.reset();
|
||||
out.reset();
|
||||
cdISO_8859_1 = StandardCharsets.ISO_8859_1.newDecoder();
|
||||
cdISO_8859_1 = ISO_8859_1.INSTANCE.newDecoder();
|
||||
return cdISO_8859_1.decode(in, out, false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue