gmazza      2003/10/07 13:38:33

  Modified:    src/org/apache/fop/apps Tag: fop-0_20_2-maintain Driver.java
  Log:
  Porting from trunk back to maintenance a check for a null class loader while loading 
ElementMappings; code originally done by Keiron
  
  
http://cvs.apache.org/viewcvs.cgi/xml-fop/src/org/apache/fop/apps/Attic/Driver.java.diff?r1=1.37&r2=1.38&diff_format=h
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.36.2.12 +9 -3      xml-fop/src/org/apache/fop/apps/Attic/Driver.java
  
  Index: Driver.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/Attic/Driver.java,v
  retrieving revision 1.36.2.11
  retrieving revision 1.36.2.12
  diff -u -r1.36.2.11 -r1.36.2.12
  --- Driver.java       8 Sep 2003 22:15:27 -0000       1.36.2.11
  +++ Driver.java       7 Oct 2003 20:38:33 -0000       1.36.2.12
  @@ -581,14 +581,20 @@
   
       public static synchronized Enumeration providers(Class cls) {
           ClassLoader cl = cls.getClassLoader();
  +        // null if loaded by bootstrap class loader 
  +        if(cl == null) { 
  +           cl = ClassLoader.getSystemClassLoader(); 
  +        } 
  +        
           String serviceFile = "META-INF/services/" + cls.getName();
   
           // System.out.println("File: " + serviceFile);
   
           Vector v = (Vector)providerMap.get(serviceFile);
  -        if (v != null)
  +        if (v != null) {
               return v.elements();
  -
  +        }
  +        
           v = new Vector();
           providerMap.put(serviceFile, v);
   
  
  
  

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

Reply via email to