api/src/main/java/org/apache/myfaces/core/api/shared/lang/ClassUtils.java [129:220]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static <T> Class<T> classForName(String type) throws ClassNotFoundException
    {
        Assert.notNull(type, "type");
 
        try
        {
            // Try WebApp ClassLoader first
            return (Class<T>) Class.forName(type,
                    false, // do not initialize for faster startup
                    getContextClassLoader());
        }
        catch (ClassNotFoundException ignore)
        {
            // fallback: Try ClassLoader for ClassUtils (i.e. the myfaces.jar lib)
            return (Class<T>) Class.forName(type,
                    false, // do not initialize for faster startup
                    ClassUtils.class.getClassLoader());
        }
    }

    /**
     * Same as {@link #classForName(String)}, but throws a RuntimeException (FacesException) instead of a
     * ClassNotFoundException.
     * 
     * @return the corresponding Class
     * @throws NullPointerException
     *             if type is null
     * @throws FacesException
     *             if class not found
     */
    public static Class simpleClassForName(String type)
    {
        return simpleClassForName(type, true);
    }

    /**
     * Same as {link {@link #simpleClassForName(String)}, but will only
     * log the exception and rethrow a RunTimeException if logAndThrowException is true.
     *
     * @param type
     * @param logAndThrowException - true to log and throw FacesException, false to avoid logging and throwing 
     *  the FacesException
     * @return the corresponding Class
     * @throws FacesException if class not found and logAndThrowException is true
     */
    public static Class simpleClassForName(String type, boolean logAndThrowException)
    {
        Class returnClass = null;
        try
        {
            returnClass = classForName(type);
        }
        catch (ClassNotFoundException e)
        {
            if (logAndThrowException)
            {
                log.log(Level.SEVERE, "Class " + type + " not found", e);
                throw new FacesException(e);
            }
        }
        return returnClass;
    }

    /**
     * Same as {link {@link #simpleClassForName(String)}, but accepts two booleans
     * One to log an exception and another to rethrow a FacesExceptions
     *
     * @param type
     * @param logException - true to log the ClassNotFoundException, false to avoid logging
     * @param throwException - true to throw a FacesException, false to avoid throwing a FacesException
     * @return the corresponding Class
     * @throws FacesException if class not found and throwException is true
     */
    public static Class simpleClassForName(String type, boolean throwException, boolean logException)
    {
        Class returnClass = null;
        try
        {
            returnClass = classForName(type);
        }
        catch (ClassNotFoundException e)
        {
            if(logException)
            {
                log.log(Level.SEVERE, "Class " + type + " not found", e);
            }
            if (throwException)
            {
                throw new FacesException(e);
            }
        }
        return returnClass;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



impl/src/main/java/org/apache/myfaces/util/lang/ClassUtils.java [205:302]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public static <T> Class<T> classForName(String type) throws ClassNotFoundException
    {
        Assert.notNull(type, "type");

        try
        {
            // Try WebApp ClassLoader first
            return (Class<T>) Class.forName(type,
                    false, // do not initialize for faster startup
                    getContextClassLoader());
        }
        catch (ClassNotFoundException ignore)
        {
            // fallback: Try ClassLoader for ClassUtils (i.e. the myfaces.jar lib)
            return (Class<T>) Class.forName(type,
                    false, // do not initialize for faster startup
                    ClassUtils.class.getClassLoader());
        }
    }

    /**
     * Same as {@link #classForName(String)}, but throws a RuntimeException (FacesException) instead of a
     * ClassNotFoundException.
     *
     * @return the corresponding Class
     * @throws NullPointerException
     *             if type is null
     * @throws FacesException
     *             if class not found
     */
    // @Override MYFACES-4449: Methods that call ClassUtils.class.getClassLoader() need to be here
    //           as well as in the API ClassUtils so that the correct ClassLoader is used.
    public static Class simpleClassForName(String type)
    {
        return simpleClassForName(type, true);
    }

    /**
     * Same as {link {@link #simpleClassForName(String)}, but will only
     * log the exception and rethrow a RunTimeException if logAndThrowException is true.
     *
     * @param type
     * @param logAndThrowException - true to log and throw FacesException, false to avoid logging and throwing 
     *  the FacesException
     * @return the corresponding Class
     * @throws FacesException if class not found and logAndThrowException is true
     */
    // @Override MYFACES-4449: Methods that call ClassUtils.class.getClassLoader() need to be here
    //           as well as in the API ClassUtils so that the correct ClassLoader is used.
    public static Class simpleClassForName(String type, boolean logAndThrowException)
    {
        Class returnClass = null;
        try
        {
            returnClass = classForName(type);
        }
        catch (ClassNotFoundException e)
        {
            if (logAndThrowException)
            {
                log.log(Level.SEVERE, "Class " + type + " not found", e);
                throw new FacesException(e);
            }
        }
        return returnClass;
    }

    /**
     * Same as {link {@link #simpleClassForName(String)}, but accepts two booleans
     * One to log an exception and another to rethrow a FacesExceptions
     *
     * @param type
     * @param logException - true to log the ClassNotFoundException, false to avoid logging
     * @param throwException - true to throw a FacesException, false to avoid throwing a FacesException
     * @return the corresponding Class
     * @throws FacesException if class not found and throwException is true
     */
    // @Override MYFACES-4449: Methods that call ClassUtils.class.getClassLoader() need to be here
    //           as well as in the API ClassUtils so that the correct ClassLoader is used.
    public static Class simpleClassForName(String type, boolean throwException, boolean logException)
    {
        Class returnClass = null;
        try
        {
            returnClass = classForName(type);
        }
        catch (ClassNotFoundException e)
        {
            if(logException)
            {
                log.log(Level.SEVERE, "Class " + type + " not found", e);
            }
            if (throwException)
            {
                throw new FacesException(e);
            }
        }
        return returnClass;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



