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

Avoid charset lookup machinery in java.nio.charset.StandardCharsets

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:

      Description

      The public fields of StandardCharsets are part of the public API, so they definitely need to exist. So let's create them directly (i.e. using "new", not Charset.forName) and don't bother putting these fields anywhere else (i.e. get rid of the INSTANCE singleton fields)

      (Motivation: I ran into trouble using reflection via StandardCharsets.<clinit> too early during bootstrap with a local mod.)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              martin Martin Buchholz
              Reporter:
              martin Martin Buchholz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: