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

(cs) Charset.availableCharsets throws NPE if "non-standard" charset is not present

    Details

      Description

      Charset.availableCharsets throws NullPointerException if any of the charsets listed in StandardCharsets is not present (all "standard" charsets, as listed in java.nio.charset.Charsets, are persent)

      /opt/my/usg169/space/export/xxx/build/tests/image/bin/java
      AvailableCharsetNames
      Exception in thread "main" java.lang.NullPointerException
             at java.nio.charset.Charset.put(Charset.java:549)
             at java.nio.charset.Charset.access$300(Charset.java:272)
             at java.nio.charset.Charset$4.run(Charset.java:587)
             at java.nio.charset.Charset$4.run(Charset.java:582)
             at java.security.AccessController.doPrivileged(Native Method)
             at java.nio.charset.Charset.availableCharsets(Charset.java:581)
             at AvailableCharsetNames.main(AvailableCharsetNames.java:17)

      Should I be expecting at least "US-ASCII" as one of the entries in
      availableCharsets() ?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                alanb Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: