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

Update ServerSocket.isBound spec to reflect implementation after close

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P4
    • 14
    • core-libs
    • None
    • behavioral
    • minimal
    • Just a documentation change to make spec compatible with existing behavior.
    • Java API
    • SE

    Description

      Summary

      Documentation clarification in java.net.ServerSocket. No behavior change.

      Problem

      In a previous change (6505016) most of the other socket types had the same clarification added but this was overlooked. ServerSocket::isBound returns true after a socket was bound but is now closed. The docs need to state this explicitly

      Solution

      Doc change as shown below

      Specification

      Add text shown to ServerSocket::isBound apidoc:

      diff -r 40006c0ada91 src/java.base/share/classes/java/net/ServerSocket.java
      --- a/src/java.base/share/classes/java/net/ServerSocket.java    Wed Aug 21 00:08:35 2019 +0200
      +++ b/src/java.base/share/classes/java/net/ServerSocket.java    Wed Aug 21 16:40:44 2019 +0100
      @@ -710,6 +710,10 @@
      
           /**
            * Returns the binding state of the ServerSocket.
      +     * <p>
      +     * If the socket was bound prior to being {@linkplain #close closed},
      +     * then this method will continue to return {@code true}
      +     * after the socket is closed.
            *
            * @return true if the ServerSocket successfully bound to an address
            * @since 1.4
      

      Attachments

        Issue Links

          Activity

            People

              michaelm Michael McMahon
              michaelm Michael McMahon
              Chris Hegarty, Daniel Fuchs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: