Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272120

Avoid looking for standard encodings in "java." modules

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 17, 18
    • Fix Version/s: 18
    • Component/s: core-libs
    • Labels:
    • Resolved In Build:
      b11
    • CPU:
      generic
    • OS:
      generic

      Description

      This is the continuation of JDK-8233884 and JDK-8271456. This change affects fewer cases so I fix all "java." modules at once.

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serb Sergey Bylokhov
              Reporter:
              serb Sergey Bylokhov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: