< prev index next >
src/java.base/share/classes/java/net/URL.java
Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea
@@ -347,11 +347,11 @@
*
* @param protocol the name of the protocol to use.
* @param host the name of the host.
* @param port the port number on the host.
* @param file the file on the host
- * @exception MalformedURLException if an unknown protocol or the port
+ * @throws MalformedURLException if an unknown protocol or the port
* is a negative number other than -1
* @see java.lang.System#getProperty(java.lang.String)
* @see java.net.URL#setURLStreamHandlerFactory(
* java.net.URLStreamHandlerFactory)
* @see java.net.URLStreamHandler
@@ -376,11 +376,11 @@
* No validation of the inputs is performed by this constructor.
*
* @param protocol the name of the protocol to use.
* @param host the name of the host.
* @param file the file on the host.
- * @exception MalformedURLException if an unknown protocol is specified.
+ * @throws MalformedURLException if an unknown protocol is specified.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
*/
public URL(String protocol, String host, String file)
throws MalformedURLException {
@@ -410,13 +410,13 @@
* @param protocol the name of the protocol to use.
* @param host the name of the host.
* @param port the port number on the host.
* @param file the file on the host
* @param handler the stream handler for the URL.
- * @exception MalformedURLException if an unknown protocol or the port
+ * @throws MalformedURLException if an unknown protocol or the port
is a negative number other than -1
- * @exception SecurityException
+ * @throws SecurityException
* if a security manager exists and its
* {@code checkPermission} method doesn't allow
* specifying a stream handler explicitly.
* @see java.lang.System#getProperty(java.lang.String)
* @see java.net.URL#setURLStreamHandlerFactory(
@@ -492,11 +492,11 @@
* <p>
* This constructor is equivalent to a call to the two-argument
* constructor with a {@code null} first argument.
*
* @param spec the {@code String} to parse as a URL.
- * @exception MalformedURLException if no protocol is specified, or an
+ * @throws MalformedURLException if no protocol is specified, or an
* unknown protocol is found, or {@code spec} is {@code null},
* or the parsed URL fails to comply with the specific syntax
* of the associated protocol.
* @see java.net.URL#URL(java.net.URL, java.lang.String)
*/
@@ -541,11 +541,11 @@
* <p>
* For a more detailed description of URL parsing, refer to RFC2396.
*
* @param context the context in which to parse the specification.
* @param spec the {@code String} to parse as a URL.
- * @exception MalformedURLException if no protocol is specified, or an
+ * @throws MalformedURLException if no protocol is specified, or an
* unknown protocol is found, or {@code spec} is {@code null},
* or the parsed URL fails to comply with the specific syntax
* of the associated protocol.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
@@ -563,15 +563,15 @@
* occurs as with the two argument constructor.
*
* @param context the context in which to parse the specification.
* @param spec the {@code String} to parse as a URL.
* @param handler the stream handler for the URL.
- * @exception MalformedURLException if no protocol is specified, or an
+ * @throws MalformedURLException if no protocol is specified, or an
* unknown protocol is found, or {@code spec} is {@code null},
* or the parsed URL fails to comply with the specific syntax
* of the associated protocol.
- * @exception SecurityException
+ * @throws SecurityException
* if a security manager exists and its
* {@code checkPermission} method doesn't allow
* specifying a stream handler.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
@@ -1040,11 +1040,11 @@
* This method functions in the same way as {@code new URI (this.toString())}.
* <p>Note, any URL instance that complies with RFC 2396 can be converted
* to a URI. However, some URLs that are not strictly in compliance
* can not be converted to a URI.
*
- * @exception URISyntaxException if this URL is not formatted strictly according to
+ * @throws URISyntaxException if this URL is not formatted strictly according to
* RFC2396 and cannot be converted to a URI.
*
* @return a URI instance equivalent to this URL.
* @since 1.5
*/
@@ -1080,11 +1080,11 @@
* HttpURLConnection will be returned, and for JAR a
* JarURLConnection will be returned.</P>
*
* @return a {@link java.net.URLConnection URLConnection} linking
* to the URL.
- * @exception IOException if an I/O exception occurs.
+ * @throws IOException if an I/O exception occurs.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
*/
public URLConnection openConnection() throws java.io.IOException {
return handler.openConnection(this);
@@ -1101,17 +1101,17 @@
*
* @param proxy the Proxy through which this connection
* will be made. If direct connection is desired,
* Proxy.NO_PROXY should be specified.
* @return a {@code URLConnection} to the URL.
- * @exception IOException if an I/O exception occurs.
- * @exception SecurityException if a security manager is present
+ * @throws IOException if an I/O exception occurs.
+ * @throws SecurityException if a security manager is present
* and the caller doesn't have permission to connect
* to the proxy.
- * @exception IllegalArgumentException will be thrown if proxy is null,
+ * @throws IllegalArgumentException will be thrown if proxy is null,
* or proxy has the wrong type
- * @exception UnsupportedOperationException if the subclass that
+ * @throws UnsupportedOperationException if the subclass that
* implements the protocol handler doesn't support
* this method.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
* @see java.net.URLConnection
@@ -1146,11 +1146,11 @@
* <blockquote><pre>
* openConnection().getInputStream()
* </pre></blockquote>
*
* @return an input stream for reading from the URL connection.
- * @exception IOException if an I/O exception occurs.
+ * @throws IOException if an I/O exception occurs.
* @see java.net.URL#openConnection()
* @see java.net.URLConnection#getInputStream()
*/
public final InputStream openStream() throws java.io.IOException {
return openConnection().getInputStream();
@@ -1161,11 +1161,11 @@
* <blockquote><pre>
* openConnection().getContent()
* </pre></blockquote>
*
* @return the contents of this URL.
- * @exception IOException if an I/O exception occurs.
+ * @throws IOException if an I/O exception occurs.
* @see java.net.URLConnection#getContent()
*/
public final Object getContent() throws java.io.IOException {
return openConnection().getContent();
}
@@ -1178,11 +1178,11 @@
*
* @param classes an array of Java types
* @return the content object of this URL that is the first match of
* the types specified in the classes array.
* null if none of the requested types are supported.
- * @exception IOException if an I/O exception occurs.
+ * @throws IOException if an I/O exception occurs.
* @see java.net.URLConnection#getContent(Class[])
* @since 1.3
*/
public final Object getContent(Class<?>[] classes)
throws java.io.IOException {
@@ -1206,12 +1206,12 @@
* the security manager's {@code checkSetFactory} method
* to ensure the operation is allowed.
* This could result in a SecurityException.
*
* @param fac the desired factory.
- * @exception Error if the application has already set a factory.
- * @exception SecurityException if a security manager exists and its
+ * @throws Error if the application has already set a factory.
+ * @throws SecurityException if a security manager exists and its
* {@code checkSetFactory} method doesn't allow
* the operation.
* @see java.net.URL#URL(java.lang.String, java.lang.String,
* int, java.lang.String)
* @see java.net.URLStreamHandlerFactory
< prev index next >