jaxp/src/java.xml/share/classes/javax/xml/validation/SchemaFactoryFinder.java
changeset 31287 d6581a7c221f
parent 27574 2e8afdf5c6fb
child 31497 4a6b2e733c0d
equal deleted inserted replaced
31286:4c6b605ceb9f 31287:d6581a7c221f
   416     }
   416     }
   417 
   417 
   418     private static final Class<SchemaFactory> SERVICE_CLASS = SchemaFactory.class;
   418     private static final Class<SchemaFactory> SERVICE_CLASS = SchemaFactory.class;
   419 
   419 
   420 
   420 
       
   421     // Used for debugging purposes
   421     private static String which( Class<?> clazz ) {
   422     private static String which( Class<?> clazz ) {
   422         return which( clazz.getName(), clazz.getClassLoader() );
   423         return ss.getClassSource(clazz);
   423     }
       
   424 
       
   425     /**
       
   426      * <p>Search the specified classloader for the given classname.</p>
       
   427      *
       
   428      * @param classname the fully qualified name of the class to search for
       
   429      * @param loader the classloader to search
       
   430      *
       
   431      * @return the source location of the resource, or null if it wasn't found
       
   432      */
       
   433     private static String which(String classname, ClassLoader loader) {
       
   434 
       
   435         String classnameAsResource = classname.replace('.', '/') + ".class";
       
   436 
       
   437         if( loader==null )  loader = ClassLoader.getSystemClassLoader();
       
   438 
       
   439         //URL it = loader.getResource(classnameAsResource);
       
   440         URL it = ss.getResourceAsURL(loader, classnameAsResource);
       
   441         if (it != null) {
       
   442             return it.toString();
       
   443         } else {
       
   444             return null;
       
   445         }
       
   446     }
   424     }
   447 }
   425 }