incubator-adffaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Winer" <awi...@gmail.com>
Subject Re: svn commit: r505339 - in /incubator/adffaces/trunk/trinidad: trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/ trinidad-impl/src/main/java/org/apache/myface
Date Fri, 09 Feb 2007 17:25:53 GMT
This checkin doesn't seem right.

The ClassLoaderUtils changes are unnecessary, as
ClassLoaderUtils already checks the context ClassLoader
first;  there's no reason for the change to this code.

And all the changes to the other classes are wrong:  they
should just be calling ClassLoaderUtils.loadClass(String),
which is the utility function we have for this purpose.

So, for example, instead of:

     laf = Class.forName(lafString);

becoming:

     laf = Class.forName(lafString, true,
                          Thread.currentThread().getContextClassLoader());

it should be:

    laf = ClassLoaderUtils.loadClass(lafString);

-- Adam



On 2/9/07, matzew@apache.org <matzew@apache.org> wrote:
> Author: matzew
> Date: Fri Feb  9 08:02:27 2007
> New Revision: 505339
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=505339
> Log:
> ADFFACES-378 thanks to Bud Osterberg for the patch
>
> Modified:
>     incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java
>     incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
>     incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/xml/parse/ColorizedIconParser.java
>     incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/ExternalContextUtils.java
>
> Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java
> URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java?view=diff&rev=505339&r1=505338&r2=505339
> ==============================================================================
> --- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java
(original)
> +++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/ClassLoaderUtils.java
Fri Feb  9 08:02:27 2007
> @@ -129,7 +129,8 @@
>        if (callerClassLoader != null)
>          clazz = callerClassLoader.loadClass(name);
>        else
> -        clazz = Class.forName(name);
> +        clazz = Class.forName(name, true,
> +                              Thread.currentThread().getContextClassLoader());
>      }
>
>      return clazz;
>
> Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
> URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java?view=diff&rev=505339&r1=505338&r2=505339
> ==============================================================================
> --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
(original)
> +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/UploadedFileProcessorImpl.java
Fri Feb  9 08:02:27 2007
> @@ -241,8 +241,9 @@
>      Class request;
>      try
>      {
> -      context = Class.forName("javax.portlet.PortletContext");
> -      request = Class.forName("javax.portlet.PortletRequest");
> +      ClassLoader loader = Thread.currentThread().getContextClassLoader();
> +      context = Class.forName("javax.portlet.PortletContext", true, loader);
> +      request = Class.forName("javax.portlet.PortletRequest", true, loader);
>      }
>      catch (final ClassNotFoundException e)
>      {
>
> Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/xml/parse/ColorizedIconParser.java
> URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/xml/parse/ColorizedIconParser.java?view=diff&rev=505339&r1=505338&r2=505339
> ==============================================================================
> --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/xml/parse/ColorizedIconParser.java
(original)
> +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/image/xml/parse/ColorizedIconParser.java
Fri Feb  9 08:02:27 2007
> @@ -73,7 +73,8 @@
>      Class<?> laf = null;
>      try
>      {
> -      laf = Class.forName(lafString);
> +      laf = Class.forName(lafString, true,
> +                          Thread.currentThread().getContextClassLoader());
>      }
>      catch ( ClassNotFoundException e )
>      {
>
> Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/ExternalContextUtils.java
> URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/ExternalContextUtils.java?view=diff&rev=505339&r1=505338&r2=505339
> ==============================================================================
> --- incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/ExternalContextUtils.java
(original)
> +++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/util/ExternalContextUtils.java
Fri Feb  9 08:02:27 2007
> @@ -241,8 +241,10 @@
>      Class actionRequest;
>      try
>      {
> -      context = Class.forName("javax.portlet.PortletContext");
> -      actionRequest = Class.forName("javax.portlet.ActionRequest");
> +      ClassLoader loader = Thread.currentThread().getContextClassLoader();
> +      context = Class.forName("javax.portlet.PortletContext", true, loader);
> +      actionRequest = Class.forName("javax.portlet.ActionRequest",
> +                                    true, loader);
>      }
>      catch (final ClassNotFoundException e)
>      {
>
>
>

Mime
View raw message