-
Enhancement
-
Resolution: Fixed
-
P4
-
11, 17
-
b14
-
generic
-
generic
This is the continuation of JDK-8233884, JDK-8271456 and JDK-8272120.
In many places standard charsets are looked up via their names, for example:
absolutePath.getBytes("UTF-8");
This could be done more efficiently(up to x20 time faster) with use of java.nio.charset.StandardCharsets:
absolutePath.getBytes(StandardCharsets.UTF_8);
The later variant also makes the code cleaner, as it is known not to throw UnsupportedEncodingException in contrary to the former variant.
Should be tested by the tier1/tier2/tier3 tests on Linux/Windows/macOS.
In many places standard charsets are looked up via their names, for example:
absolutePath.getBytes("UTF-8");
This could be done more efficiently(up to x20 time faster) with use of java.nio.charset.StandardCharsets:
absolutePath.getBytes(StandardCharsets.UTF_8);
The later variant also makes the code cleaner, as it is known not to throw UnsupportedEncodingException in contrary to the former variant.
Should be tested by the tier1/tier2/tier3 tests on Linux/Windows/macOS.