cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: ClassUtils.java
Date Tue, 15 May 2001 07:42:23 GMT


> -----Original Message-----
> From: Berin Loritsch [mailto:bloritsch@apache.org]
> Sent: den 14 maj 2001 21:42
> To: cocoon-dev@xml.apache.org
> Subject: Re: ClassUtils.java
> 
> 
> 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.

Ah... error between left and right ear. Quite common.

> 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
> 
> 

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


Mime
View raw message