cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: ClassUtils.java
Date Mon, 14 May 2001 19:42:16 GMT
Leo Sutic wrote:
> 
> Found this in ClassUtils.java:
> 
>     public static ClassLoader getClassLoader() {
>         if (ClassUtils.loader == null) {
>             setClassLoader(ClassUtils.class.getClassLoader());
>         }
> 
>         return ClassUtils.loader;
>     }
> 
> Seems to lead to infinite recursion if ClassUtils.loader is null when
> entering the method. Or am I missing something?

Your missing something.  Every Java Class has a ClassLoader.  There is
a difference between the reference to the ClassLoader and the Class's
ClassLoader.  Either way, this is probably not the best approach.

It should use the Thread's context classloader...

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message