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

Remove sun.nio.ch.Util.atBugLevel() either completely or at least get rid of volatile field 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

      JDK 5 introduced system property "sun.nio.ch.bugLevel" to deal with incompatible changes when moving from JDK 1.4 to JDK 5. This system property is now obsolete and can be removed.

      Problem

      The main motivation for doing this is to eliminate a volatile String member which causes performance penalties when accessing the bugLevel() method used to test the property value.

      Solution

      Remove the system property and the support for JDK 1.4 compatibility at the places where it is called.

      Alternative would be to reimplement atBugLevel() method without volatile field.

      Specification

      The change implies that system property "sun.nio.ch.bugLevel" is ignored from now on. Before this change, one could set system property "sun.nio.ch.bugLevel=1.4" which would cause the following exceptional behavior to enable compatibility with JDK 1.4:
      a) The methods keys() or selectedKeys() of sun.nio.ch.SelectorImpl would not throw a ClosedSelectorException when the Selector is not open.
      b) The set of keys returned by keys() would not be an Immutable set and the set of keys returned by selectedKeys() would not be an ungrowable set.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                clanger Christoph Langer
                Reporter:
                clanger Christoph Langer
                Reviewed By:
                Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: