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

Javadoc clean up in HttpsExchange, HttpsParameters, and HttpsServer

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 16
    • core-libs
    • None
    • source
    • minimal
    • Documentation updated to inform user of the pre-existing behavior of methods and constructor within class
    • Java API
    • JDK

      Summary

      The specification of com.sun.net.httpserver.HttpsServer and com.sun.net.httpserver.HttpsExchange is updated to fill in a few missing or empty API documentation comments.

      Problem

      The specification for methods create(InetSocketAddress, int) and create() in com.sun.net.httpserver.HttpsServer contain an @throws but don't specify the conditions under which this exception may be thrown. Also, the default protected constructors for classes com.sun.net.httpserver.HttpsServer and com.sun.net.httpserver.HttpsExchange have an empty/blank comment and should be updated to specify the constructor's use.

      Solution

      Update missing documentation where necessary to inform user of the default constructor's use in both com.sun.net.httpserver.HttpsServer and com.sun.net.httpserver.HttpsExchange as well as the conditions under which an IOException may be thrown when calling create(InetSocketAddress, int) and create() in com.sun.net.httpserver.HttpsExchange.

      Specification

      com.sun.net.httpserver.HttpsExchange

      +   /**
      +    * Constructor for subclasses to call.
      +    */
           protected HttpsExchange() { }

      com.sun.net.httpserver.HttpsServer

          /**
      +    * Constructor for subclasses to call.
           */
           protected HttpsServer() { }
      
      
          /**
           * Create a {@code HttpsServer} instance which will bind to the specified
           * {@link java.net.InetSocketAddress} (IP address and port number).
           *
           * A maximum backlog can also be specified. This is the maximum number of
           * queued incoming connections to allow on the listening socket. Queued TCP
           * connections exceeding this limit may be rejected by the TCP implementation.
           * The {@code HttpsServer} is acquired from the currently installed
           * {@link HttpServerProvider}. The server must have a {@code HttpsConfigurator}
           * established with {@link #setHttpsConfigurator(HttpsConfigurator)}.
           *
           * @param addr the address to listen on, if {@code null} then
           *             {@link #bind(InetSocketAddress,int)}  must be called to set
           *             the address
           * @param backlog the socket backlog. If this value is less than or equal to
           *               zero, then a system default value is used
           * @throws BindException if the server cannot bind to the requested address,
           *          or if the server is already bound
      -    * @throws IOException 
      +    * @throws IOException if an I/O error occurs
           */
           public static HttpsServer create(InetSocketAddress addr, int backlog) throws IOException {
      
      
      
          /**
           * Creates a {@code HttpsServer} instance which is initially not bound to any
           * local address/port. The {@code HttpsServer} is acquired from the currently
           * installed {@link HttpServerProvider}. The server must be bound using
           * {@link #bind(InetSocketAddress,int)} before it can be used. The server
           * must also have a {@code HttpsConfigurator} established with
           * {@link #setHttpsConfigurator(HttpsConfigurator)}.
           *
      -    * @throws IOException 
      +    * @throws IOException if an I/O error occurs
           */
           public static HttpsServer create() throws IOException {

            pconcannon Patrick Concannon (Inactive)
            pconcannon Patrick Concannon (Inactive)
            Daniel Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: