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

DatagramSocket ctor spec and ::getLocalAddress spec are mismatching

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 15
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      DatagramSocket()

      "Constructs a datagram socket and binds it to any available port on the local host machine . The socket will be bound to the wildcard address, an IP address chosen by the kernel"

      ::getLocalAddress()
      "Returns: or an InetAddress representing wildcard address if either the socket is not bound, or the security manager checkConnect method does not allow the operation"

      As the constructor spec says - the socket IS bound and calling ::getLocalAddress()::isAnyLocalAddress() hints that it's really a wildcard address.

      ::getLocalAddress() spec deserves correction/clarification/update.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pconcannon Patrick Concannon
                Reporter:
                dbessono Dmitry Bessonov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: