[antlr-interest] class loaders

Martin Probst mail at martin-probst.com
Sat Aug 5 01:56:46 PDT 2006


Hi,

> I know hibernate and other people have asked me to correct this  
> previously in ANTLR.the " correct" method was as you see first above.
>
>   So, what is the correct answer? do we need a flag that says which  
> flavor to use?

I think the problem is indeed that there is no correct way of doing  
this. Java supports AFAIK two ways of doing this, one is the class  
loader hierarchy that is being used with Class.forName() and the  
other one is the hack with Thread.currentThread 
().getContextClassLoader(), which is used by Tomcat et al. where  
containers can set this class loader for the sub-contexts in the app.  
Both ways have their justification.

Martin



More information about the antlr-interest mailing list