8294948: Document IllegalArgumentException and NullPointerException thrown by URLStreamHandler::parseURL and URLStreamHandler::setURL

Reviewed-by: jpai, aefimov, alanb, michaelm
This commit is contained in:
Daniel Fuchs 2022-10-20 08:54:45 +00:00
parent dcd46501e6
commit 9d0cfd1130
2 changed files with 52 additions and 7 deletions

View file

@ -129,6 +129,10 @@ public abstract class URLStreamHandler {
* end of the string or the position of the
* "{@code #}" character, if present. All information
* after the sharp sign indicates an anchor.
* @throws IllegalArgumentException if the implementation of the protocol
* handler rejects any of the given parameters
* @throws NullPointerException if {@code u} is {@code null},
* or if {@code start < limit} and {@code spec} is {@code null}
*/
protected void parseURL(URL u, String spec, int start, int limit) {
// These fields may receive context content if this was relative URL
@ -497,6 +501,9 @@ public abstract class URLStreamHandler {
* @param ref the reference.
* @throws SecurityException if the protocol handler of the URL is
* different from this one
* @throws IllegalArgumentException if the implementation of the protocol
* handler rejects any of the given parameters
* @throws NullPointerException if {@code u} is {@code null}
* @since 1.3
*/
protected void setURL(URL u, String protocol, String host, int port,
@ -539,6 +546,9 @@ public abstract class URLStreamHandler {
* @param ref the reference.
* @throws SecurityException if the protocol handler of the URL is
* different from this one
* @throws IllegalArgumentException if the implementation of the protocol
* handler rejects any of the given parameters
* @throws NullPointerException if {@code u} is {@code null}
* @deprecated Use setURL(URL, String, String, int, String, String, String,
* String);
*/