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

Drop property sun.nio.cs.bugLevel

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API, System or security property

      Description

      Summary

      The method java.nio.charset.Charset.atBugLevel(String bl) and its uses shall be removed completely. This means not honoring the property "sun.nio.cs.bugLevel" at this place any longer. The bugLevel was used here to cause JDK 1.4 compatible behavior which is probably obsolete by now.

      Problem

      The current problem resp. motivation why this should be done is to eliminate a volatile String member which causes performance penalties when accessing the bugLevel() method.

      Solution

      Remove bugLevel() and drop the alternative handling for JDK 1.4 compatibility at the places where it is called.

      Alternative would be to reimplement bugLevel() without volatile field.

      Specification

      The change implies that system property "sun.nio.cs.bugLevel" is ignored from now on. Before this change, one could set system property "sun.nio.cs.bugLevel=1.4" which would cause the following exceptional behavior to enable compatibility with JDK 1.4:
      a) When a constructor of Charset or any method that checks the supplied charset name is called with an empty name the result would be an UnsupportedCharsetException as opposed to the standard behavior to obtain an IllegalCharsetNameException.
      b) When the constructor of CharsetDecoder/CharsetEncoder is called, no check will be done whether the value of argument averageCharsPerByte exceeds the one of argument maxCharsPerByte. Usually one would get an IllegalArgumentException if averageCharsPerByte > maxCharsPerByte.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                clanger Christoph Langer
                Reporter:
                horii Hiroshi Horii
                Reviewed By:
                Alan Bateman, Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: