equal
deleted
inserted
replaced
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 } |