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