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

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 10
    • core-libs
    • None
    • behavioral
    • minimal
    • Java API, System or security property

      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.

            clanger Christoph Langer
            clanger Christoph Langer
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: