You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/04/07 23:05:58 UTC

svn commit: r1090010 - in /commons/proper/discovery/trunk/src/java/org/apache/commons/discovery: jdk/JDKHooks.java tools/ClassUtils.java tools/DiscoverClass.java tools/ResourceUtils.java tools/SPInterface.java

Author: simonetripodi
Date: Thu Apr  7 21:05:58 2011
New Revision: 1090010

URL: http://svn.apache.org/viewvc?rev=1090010&view=rev
Log:
added thrown exceptions description in javadoc

Modified:
    commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/jdk/JDKHooks.java
    commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ClassUtils.java
    commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/DiscoverClass.java
    commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ResourceUtils.java
    commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/SPInterface.java

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/jdk/JDKHooks.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/jdk/JDKHooks.java?rev=1090010&r1=1090009&r2=1090010&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/jdk/JDKHooks.java (original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/jdk/JDKHooks.java Thu Apr  7 21:05:58 2011
@@ -80,7 +80,7 @@ public abstract class JDKHooks {
      * @param loader The class loader used to resolve resources
      * @param resourceName The resource name to resolve
      * @return The iterator over the URL resolved resources
-     * @throws IOException
+     * @throws IOException if any error occurs while loading the resource
      */
     public abstract Enumeration<URL> getResources(ClassLoader loader, String resourceName) throws IOException;
 

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ClassUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ClassUtils.java?rev=1090010&r1=1090009&r2=1090010&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ClassUtils.java (original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ClassUtils.java Thu Apr  7 21:05:58 2011
@@ -135,11 +135,14 @@ public class ClassUtils {
      * @param paramClasses The constructor arguments types (can be {@code null})
      * @param params The constructor arguments values (can be {@code null})
      * @return A new class instance
-     * @throws DiscoveryException
-     * @throws InstantiationException
-     * @throws IllegalAccessException
-     * @throws NoSuchMethodException
-     * @throws InvocationTargetException
+     * @throws DiscoveryException if the class implementing
+     *            the SPI cannot be found, cannot be loaded and
+     *            instantiated, or if the resulting class does not implement
+     *            (or extend) the SPI
+     * @throws InstantiationException see {@link Class#newInstance()}
+     * @throws IllegalAccessException see {@link Class#newInstance()}
+     * @throws NoSuchMethodException see {@link Class#newInstance()}
+     * @throws InvocationTargetException see {@link Class#newInstance()}
      */
     public static <T> T newInstance(Class<T> impl, Class<?> paramClasses[], Object params[]) throws DiscoveryException,
                InstantiationException,
@@ -160,6 +163,7 @@ public class ClassUtils {
      *
      * @param spi The SPI type
      * @param impl The class has to be verified is a SPI implementation/extension
+     * @throws DiscoveryException if the input implementation class is not an SPI implementation
      */
     public static void verifyAncestory(Class<?> spi, Class<?> impl) throws DiscoveryException {
         if (spi == null) {

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/DiscoverClass.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/DiscoverClass.java?rev=1090010&r1=1090009&r2=1090010&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/DiscoverClass.java (original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/DiscoverClass.java Thu Apr  7 21:05:58 2011
@@ -355,6 +355,10 @@ public class DiscoverClass {
      *            the SPI cannot be found, if the class cannot be loaded and
      *            instantiated, or if the resulting class does not implement
      *            (or extend) the SPI.
+     * @throws InstantiationException see {@link Class#newInstance()}
+     * @throws IllegalAccessException see {@link Class#newInstance()}
+     * @throws NoSuchMethodException see {@link Class#newInstance()}
+     * @throws InvocationTargetException see {@link Class#newInstance()}
      */
     public <T> T newInstance(Class<T> spiClass)
         throws DiscoveryException,
@@ -381,6 +385,10 @@ public class DiscoverClass {
      *            the SPI cannot be found, if the class cannot be loaded and
      *            instantiated, or if the resulting class does not implement
      *            (or extend) the SPI.
+     * @throws InstantiationException see {@link Class#newInstance()}
+     * @throws IllegalAccessException see {@link Class#newInstance()}
+     * @throws NoSuchMethodException see {@link Class#newInstance()}
+     * @throws InvocationTargetException see {@link Class#newInstance()}
      */
     public <T> T newInstance(Class<T> spiClass, Properties properties) throws DiscoveryException,
                InstantiationException,
@@ -404,6 +412,10 @@ public class DiscoverClass {
      *            the SPI cannot be found, if the class cannot be loaded and
      *            instantiated, or if the resulting class does not implement
      *            (or extend) the SPI.
+     * @throws InstantiationException see {@link Class#newInstance()}
+     * @throws IllegalAccessException see {@link Class#newInstance()}
+     * @throws NoSuchMethodException see {@link Class#newInstance()}
+     * @throws InvocationTargetException see {@link Class#newInstance()}
      */
     public <T> T newInstance(Class<T> spiClass, String defaultImpl) throws DiscoveryException,
                InstantiationException,
@@ -430,6 +442,10 @@ public class DiscoverClass {
      *            the SPI cannot be found, if the class cannot be loaded and
      *            instantiated, or if the resulting class does not implement
      *            (or extend) the SPI.
+     * @throws InstantiationException see {@link Class#newInstance()}
+     * @throws IllegalAccessException see {@link Class#newInstance()}
+     * @throws NoSuchMethodException see {@link Class#newInstance()}
+     * @throws InvocationTargetException see {@link Class#newInstance()}
      */
     public <T> T newInstance(Class<T> spiClass, Properties properties, String defaultImpl) throws DiscoveryException,
                InstantiationException,
@@ -456,6 +472,10 @@ public class DiscoverClass {
      *            the SPI cannot be found, if the class cannot be loaded and
      *            instantiated, or if the resulting class does not implement
      *            (or extend) the SPI.
+     * @throws InstantiationException see {@link Class#newInstance()}
+     * @throws IllegalAccessException see {@link Class#newInstance()}
+     * @throws NoSuchMethodException see {@link Class#newInstance()}
+     * @throws InvocationTargetException see {@link Class#newInstance()}
      */
     public <T> T newInstance(Class<T> spiClass, String propertiesFileName, String defaultImpl)
             throws DiscoveryException,
@@ -484,6 +504,10 @@ public class DiscoverClass {
      *            the SPI cannot be found, if the class cannot be loaded and
      *            instantiated, or if the resulting class does not implement
      *            (or extend) the SPI.
+     * @throws InstantiationException see {@link Class#newInstance()}
+     * @throws IllegalAccessException see {@link Class#newInstance()}
+     * @throws NoSuchMethodException see {@link Class#newInstance()}
+     * @throws InvocationTargetException see {@link Class#newInstance()}
      */
     public static <T> T newInstance(ClassLoaders loaders,
                                      SPInterface<T> spi,

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ResourceUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ResourceUtils.java?rev=1090010&r1=1090009&r2=1090010&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ResourceUtils.java (original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/ResourceUtils.java Thu Apr  7 21:05:58 2011
@@ -72,7 +72,10 @@ public class ResourceUtils {
      * @param resourceName The name of the resource to load.
      * @param loaders the class loaders holder
      * @return The discovered {@link Resource} instance
-     * @throws DiscoveryException
+     * @throws DiscoveryException if the class implementing
+     *            the SPI cannot be found, cannot be loaded and
+     *            instantiated, or if the resulting class does not implement
+     *            (or extend) the SPI
      */
     public static Resource getResource(Class<?> spi,
                                        String resourceName,

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/SPInterface.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/SPInterface.java?rev=1090010&r1=1090009&r2=1090010&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/SPInterface.java (original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/tools/SPInterface.java Thu Apr  7 21:05:58 2011
@@ -157,11 +157,14 @@ public class SPInterface<T> {
      * @param <S> Any type extends T
      * @param impl The SPI class has to be instantiated
      * @return A new instance of the given SPI class
-     * @throws DiscoveryException
-     * @throws InstantiationException
-     * @throws IllegalAccessException
-     * @throws NoSuchMethodException
-     * @throws InvocationTargetException
+     * @throws DiscoveryException if the class implementing
+     *            the SPI cannot be found, cannot be loaded and
+     *            instantiated, or if the resulting class does not implement
+     *            (or extend) the SPI
+     * @throws InstantiationException see {@link Class#newInstance()}
+     * @throws IllegalAccessException see {@link Class#newInstance()}
+     * @throws NoSuchMethodException see {@link Class#newInstance()}
+     * @throws InvocationTargetException see {@link Class#newInstance()}
      */
     public <S extends T> S newInstance(Class<S> impl)
         throws DiscoveryException,