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

Default value of Authenticator.getRequestingURL() is not specified

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 25
    • core-libs
    • None
    • behavioral
    • minimal
    • Java API
    • SE

      Summary

      Clarify that null may be returned when the requesting URL is not specified in an authentication request.

      Problem

      The Authenticator.RequestorType.getRequestingURL() method currently specifies that it returns the URL that resulted in the authentication request. However, it does not document the case where the request does not include a URL, in which case the method returns null. This can be misleading to developers who expect a non-null value under all conditions.

      Solution

      Clarify the current behavior by updating the JavaDoc to state that null may be returned if no URL is associated with the authentication request.

      Specification

      Update the JavaDoc comment of the getRequestingURL() method in the Authenticator.RequestorType class to include:

       /**
      -     * Returns the URL that resulted in this
      -     * request for authentication.
      +     * Returns the URL that resulted in this request for authentication.
      +     * If the corresponding request does not specify a URL, this method returns null.
            *
            * @since 1.5
            *
      -     * @return the requesting URL
      +     * @return the requesting URL, or null if not available.

            kfarrell Kieran Farrell
            sreznick Sergey Reznick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: