dion        2003/01/29 08:01:29

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/core
                        UseBeanTag.java
  Log:
  Make sure there is a class loader before using it
  
  Revision  Changes    Path
  1.11      +5 -1      
jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/UseBeanTag.java
  
  Index: UseBeanTag.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/core/UseBeanTag.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- UseBeanTag.java   29 Jan 2003 15:45:36 -0000      1.10
  +++ UseBeanTag.java   29 Jan 2003 16:01:29 -0000      1.11
  @@ -175,7 +175,11 @@
        */    
       protected Class loadClass(String className) throws ClassNotFoundException {
           try {
  -          return 
Thread.currentThread().getContextClassLoader().loadClass(className);
  +          ClassLoader loader = Thread.currentThread().getContextClassLoader();
  +          if (loader == null) {
  +              loader = getClass().getClassLoader();
  +          }
  +          return loader.loadClass(className);
           } catch (ClassNotFoundException e) {
               return getClass().getClassLoader().loadClass(className);
           }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to