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

@ -25,6 +25,8 @@
package sun.nio.fs;
import sun.nio.cs.UTF_8;
import jdk.internal.util.StaticProperty;
import java.nio.file.*;
@ -277,7 +279,7 @@ abstract class UnixFileStore
Path file = Path.of(fstypes);
try {
try (ReadableByteChannel rbc = Files.newByteChannel(file)) {
result.load(Channels.newReader(rbc, "UTF-8"));
result.load(Channels.newReader(rbc, UTF_8.INSTANCE));
}
} catch (IOException x) {
}