mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +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
|
@ -34,7 +34,6 @@ import java.io.RandomAccessFile;
|
|||
import java.io.UncheckedIOException;
|
||||
import java.lang.ref.Cleaner.Cleanable;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.InvalidPathException;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.nio.file.Files;
|
||||
|
@ -65,6 +64,7 @@ import jdk.internal.misc.VM;
|
|||
import jdk.internal.perf.PerfCounter;
|
||||
import jdk.internal.ref.CleanerFactory;
|
||||
import jdk.internal.vm.annotation.Stable;
|
||||
import sun.nio.cs.UTF_8;
|
||||
|
||||
import static java.util.zip.ZipConstants64.*;
|
||||
import static java.util.zip.ZipUtils.*;
|
||||
|
@ -165,7 +165,7 @@ public class ZipFile implements ZipConstants, Closeable {
|
|||
* @since 1.3
|
||||
*/
|
||||
public ZipFile(File file, int mode) throws IOException {
|
||||
this(file, mode, StandardCharsets.UTF_8);
|
||||
this(file, mode, UTF_8.INSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1042,7 +1042,7 @@ public class ZipFile implements ZipConstants, Closeable {
|
|||
for (int i = 0; i < names.length; i++) {
|
||||
int pos = zsrc.metanames[i];
|
||||
names[i] = new String(cen, pos + CENHDR, CENNAM(cen, pos),
|
||||
StandardCharsets.UTF_8);
|
||||
UTF_8.INSTANCE);
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue