< prev index next >

src/java.base/share/classes/java/net/URLClassLoader.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

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -99,14 +99,14 @@
      * calls the security manager's {@code checkCreateClassLoader} method
      * to ensure creation of a class loader is allowed.
      *
      * @param urls the URLs from which to load classes and resources
      * @param parent the parent class loader for delegation
-     * @exception  SecurityException  if a security manager exists and its
+     * @throws     SecurityException  if a security manager exists and its
      *             {@code checkCreateClassLoader} method doesn't allow
      *             creation of a class loader.
-     * @exception  NullPointerException if {@code urls} or any of its
+     * @throws     NullPointerException if {@code urls} or any of its
      *             elements is {@code null}.
      * @see SecurityManager#checkCreateClassLoader
      */
     public URLClassLoader(URL[] urls, ClassLoader parent) {
         super(parent);

@@ -134,14 +134,14 @@
      * calls the security manager's {@code checkCreateClassLoader} method
      * to ensure creation of a class loader is allowed.
      *
      * @param urls the URLs from which to load classes and resources
      *
-     * @exception  SecurityException  if a security manager exists and its
+     * @throws     SecurityException  if a security manager exists and its
      *             {@code checkCreateClassLoader} method doesn't allow
      *             creation of a class loader.
-     * @exception  NullPointerException if {@code urls} or any of its
+     * @throws     NullPointerException if {@code urls} or any of its
      *             elements is {@code null}.
      * @see SecurityManager#checkCreateClassLoader
      */
     public URLClassLoader(URL[] urls) {
         super();

@@ -168,14 +168,14 @@
      *
      * @param urls the URLs from which to load classes and resources
      * @param parent the parent class loader for delegation
      * @param factory the URLStreamHandlerFactory to use when creating URLs
      *
-     * @exception  SecurityException  if a security manager exists and its
+     * @throws SecurityException  if a security manager exists and its
      *             {@code checkCreateClassLoader} method doesn't allow
      *             creation of a class loader.
-     * @exception  NullPointerException if {@code urls} or any of its
+     * @throws NullPointerException if {@code urls} or any of its
      *             elements is {@code null}.
      * @see SecurityManager#checkCreateClassLoader
      */
     public URLClassLoader(URL[] urls, ClassLoader parent,
                           URLStreamHandlerFactory factory) {

@@ -324,17 +324,17 @@
     * The method makes a best effort attempt to close all opened files,
     * by catching {@link IOException}s internally. Unchecked exceptions
     * and errors are not caught. Calling close on an already closed
     * loader has no effect.
     *
-    * @exception IOException if closing any file opened by this class loader
+    * @throws    IOException if closing any file opened by this class loader
     * resulted in an IOException. Any such exceptions are caught internally.
     * If only one is caught, then it is re-thrown. If more than one exception
     * is caught, then the second and following exceptions are added
     * as suppressed exceptions of the first one caught, which is then re-thrown.
     *
-    * @exception SecurityException if a security manager is set, and it denies
+    * @throws    SecurityException if a security manager is set, and it denies
     *   {@link RuntimePermission}{@code ("closeClassLoader")}
     *
     * @since 1.7
     */
     public void close() throws IOException {

@@ -401,13 +401,13 @@
      * path. Any URLs referring to JAR files are loaded and opened as needed
      * until the class is found.
      *
      * @param name the name of the class
      * @return the resulting class
-     * @exception ClassNotFoundException if the class could not be found,
+     * @throws    ClassNotFoundException if the class could not be found,
      *            or if the loader is closed.
-     * @exception NullPointerException if {@code name} is {@code null}.
+     * @throws    NullPointerException if {@code name} is {@code null}.
      */
     protected Class<?> findClass(final String name)
         throws ClassNotFoundException
     {
         final Class<?> result;

@@ -626,11 +626,11 @@
     /**
      * Returns an Enumeration of URLs representing all of the resources
      * on the URL search path having the specified name.
      *
      * @param name the resource name
-     * @exception IOException if an I/O exception occurs
+     * @throws    IOException if an I/O exception occurs
      * @return An {@code Enumeration} of {@code URL}s.
      *         If the loader is closed, the Enumeration contains no elements.
      */
     public Enumeration<URL> findResources(final String name)
         throws IOException

@@ -694,11 +694,11 @@
      * that directory.
      * <p>
      * If the protocol is not "file", then permission
      * to connect to and accept connections from the URL's host is granted.
      * @param codesource the codesource
-     * @exception NullPointerException if {@code codesource} is {@code null}.
+     * @throws    NullPointerException if {@code codesource} is {@code null}.
      * @return the permissions granted to the codesource
      */
     protected PermissionCollection getPermissions(CodeSource codesource)
     {
         PermissionCollection perms = super.getPermissions(codesource);

@@ -774,11 +774,11 @@
      * {@code SecurityManager.checkPackageAccess} method before
      * loading the class.
      *
      * @param urls the URLs to search for classes and resources
      * @param parent the parent class loader for delegation
-     * @exception  NullPointerException if {@code urls} or any of its
+     * @throws     NullPointerException if {@code urls} or any of its
      *             elements is {@code null}.
      * @return the resulting class loader
      */
     public static URLClassLoader newInstance(final URL[] urls,
                                              final ClassLoader parent) {

@@ -801,11 +801,11 @@
      * returned by this method will invoke the
      * {@code SecurityManager.checkPackageAccess} before
      * loading the class.
      *
      * @param urls the URLs to search for classes and resources
-     * @exception  NullPointerException if {@code urls} or any of its
+     * @throws     NullPointerException if {@code urls} or any of its
      *             elements is {@code null}.
      * @return the resulting class loader
      */
     public static URLClassLoader newInstance(final URL[] urls) {
         // Save the caller's context
< prev index next >