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

(se spec) SelectionKey.OP_READ/OP_WRITE documentation errors

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 15
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Changes the specification to match longstanding behavior.
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Correct the specification of SelectionKey.OP_READ and SelectionKey.OP_WRITE.

      Problem

      The specification incorrectly states that OP_READ, OP_WRITE, respectively, will be added to the key's ready-operation set when the corresponding channel has been remotely shut down for further reading, writing, respectively, when it should be the converse.

      Solution

      Change the specification to state that OP_READ, OP_WRITE, respectively, will be added to the key's ready-operation set when the corresponding channel has been remotely shut down for further writing, reading, respectively.

      Specification

      Please see also the attached webrev.

      OP_READ

      Operation-set bit for read operations.

      Suppose that a selection key's interest set contains OP_READ at the start of a selection operation. If the selector detects that the corresponding channel is ready for reading, has reached end-of-stream, has been remotely shut down for further writing, or has an error pending, then it will add OP_READ to the key's ready-operation set.

      OP_WRITE

      Operation-set bit for write operations.

      Suppose that a selection key's interest set contains OP_WRITE at the start of a selection operation. If the selector detects that the corresponding channel is ready for writing, has been remotely shut down for further reading, or has an error pending, then it will add OP_WRITE to the key's ready set.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bpb Brian Burkhalter
                Reporter:
                nthompsosunw Nathanael Thompson (Inactive)
                Reviewed By:
                Alan Bateman, Lance Andersen, Roger Riggs
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: