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

Document that the no-args Socket constructor uses the client socket implementation factory

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 13
    • core-libs
    • None
    • minimal
    • Java API
    • SE

      Summary

      Specify that the no-args Socket constructor invokes the client socket implementation factory, if one has been set, which is existing and long standing behavior.

      Problem

      The no-args Socket constructor omits the fact that it uses the client socket implementation factory, if one has been set.

      Solution

      Update the specification of the no-args Socket constructor to specify that it uses the client socket implementation factory, if one has been set.

      Specification

      src/java.base/share/classes/java/net/Socket.java

        /**
      -  * Creates an unconnected socket, with the
      -  * system-default type of SocketImpl.
      +  * Creates an unconnected Socket.
      +  *
      +  * If the application has specified a client socket implementation
      +  * factory, that factory's {@code createSocketImpl} method is called to
      +  * create the actual socket implementation. Otherwise a system-default
      +  * socket implementation is created.
         *
         * @since   1.1
         * @revised 1.4
         */
        public Socket()

            chegar Chris Hegarty
            chegar Chris Hegarty
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: