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.
- csr of
-
JDK-7046003 Default value of Authenticator.getRequestingURL() is not specified
-
- Open
-