JDK-8184742 : Remove sun.nio.ch.Util.atBugLevel() either completely or at least get rid of volatile field bugLevel
  • Type: CSR
  • Component: core-libs
  • Sub-Component: java.nio
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 10
  • Submitted: 2017-07-17
  • Updated: 2017-07-24
  • Resolved: 2017-07-24
Related Reports
CSR :  
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:<br>
a) The methods keys() or selectedKeys() of sun.nio.ch.SelectorImpl would not throw a ClosedSelectorException when the Selector is not open.<br>
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.

Comments
Moving request to Approved.
24-07-2017