diff -r 4c6b605ceb9f -r d6581a7c221f jaxp/src/java.xml/share/classes/javax/xml/xpath/SecuritySupport.java --- a/jaxp/src/java.xml/share/classes/javax/xml/xpath/SecuritySupport.java Thu Jun 25 11:06:28 2015 +0200 +++ b/jaxp/src/java.xml/share/classes/javax/xml/xpath/SecuritySupport.java Thu Jun 25 20:06:37 2015 +0200 @@ -92,46 +92,22 @@ } } - URL getResourceAsURL(final ClassLoader cl, - final String name) - { - return (URL) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - URL url; - if (cl == null) { - url = Object.class.getResource(name); - } else { - url = cl.getResource(name); - } - return url; - } - }); - } - - Enumeration getResources(final ClassLoader cl, - final String name) throws IOException - { - try{ - return (Enumeration) - AccessController.doPrivileged(new PrivilegedExceptionAction() { - public Object run() throws IOException{ - Enumeration enumeration; - if (cl == null) { - enumeration = ClassLoader.getSystemResources(name); - } else { - enumeration = cl.getResources(name); - } - return enumeration; - } - }); - }catch(PrivilegedActionException e){ - throw (IOException)e.getException(); - } + // Used for debugging purposes + String getClassSource(Class cls) { + return AccessController.doPrivileged(new PrivilegedAction() { + public String run() { + CodeSource cs = cls.getProtectionDomain().getCodeSource(); + if (cs != null) { + return cs.getLocation().toString(); + } else { + return "(no code source)"; + } + } + }); } boolean doesFileExist(final File f) { - return ((Boolean) + return ((Boolean) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new Boolean(f.exists());