diff options
author | Mark Wielaard <mark@klomp.org> | 2003-01-02 09:34:34 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2003-01-02 09:34:34 +0000 |
commit | 27c687cc5b931c763c28394c7172a82eac3951cb (patch) | |
tree | 1601d8243401a7c75d1d466146606e2a421c8a4b | |
parent | 3006ff7f4666cdd8de25cf4c1b1e2f95c7b7486b (diff) | |
download | gcc-27c687cc5b931c763c28394c7172a82eac3951cb.zip gcc-27c687cc5b931c763c28394c7172a82eac3951cb.tar.gz gcc-27c687cc5b931c763c28394c7172a82eac3951cb.tar.bz2 |
URLClassLoader.java (Resource.getCodeSource): Fix check certs == null.
* java/net/URLClassLoader.java (Resource.getCodeSource):
Fix check certs == null.
(getCanonicalFileURL): Removed method.
(JarURLLoader): Don't call removed method.
(FileURLLoader): Likewise.
(FileURLLoader.getResource): Don't canonicalize file name.
Co-Authored-By: Jeroen Frijters <jeroen@sumatra.nl>
From-SVN: r60780
-rw-r--r-- | libjava/ChangeLog | 10 | ||||
-rw-r--r-- | libjava/java/net/URLClassLoader.java | 33 |
2 files changed, 15 insertions, 28 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 1d3d4bd..ebc9a32 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,13 @@ +2003-01-02 Mark Wielaard <mark@klomp.org> + Jeroen Frijters <jeroen@sumatra.nl> + + * java/net/URLClassLoader.java (Resource.getCodeSource): + Fix check certs == null. + (getCanonicalFileURL): Removed method. + (JarURLLoader): Don't call removed method. + (FileURLLoader): Likewise. + (FileURLLoader.getResource): Don't canonicalize file name. + 2003-01-01 Tom Tromey <tromey@redhat.com> * Makefile.in: Rebuilt. diff --git a/libjava/java/net/URLClassLoader.java b/libjava/java/net/URLClassLoader.java index c6dc4b1..d7fc77f 100644 --- a/libjava/java/net/URLClassLoader.java +++ b/libjava/java/net/URLClassLoader.java @@ -238,7 +238,7 @@ public class URLClassLoader extends SecureClassLoader CodeSource getCodeSource() { Certificate[] certs = getCertificates(); - if (certs != null) + if (certs == null) return loader.noCertCodeSource; else return new CodeSource(loader.baseURL, certs); @@ -271,34 +271,18 @@ public class URLClassLoader extends SecureClassLoader abstract InputStream getInputStream() throws IOException; } - static URL getCanonicalFileURL(URL url) - { - if ("file".equals(url.getProtocol())) - { - try - { - File f = new File(url.getFile()).getCanonicalFile(); - url = new URL("file", "", f.toString()); - } - catch (IOException ignore) - { - } - } - return url; - } - /** * A <code>JarURLLoader</code> is a type of <code>URLLoader</code> * only loading from jar url. */ final static class JarURLLoader extends URLLoader { - final JarFile jarfile; // The canonical jar file for this url + final JarFile jarfile; // The jar file for this url final URL baseJarURL; // Base jar: url for all resources loaded from jar public JarURLLoader(URLClassLoader classloader, URL baseURL) { - super(classloader, getCanonicalFileURL(baseURL)); + super(classloader, baseURL); // cache url prefix for all resources in this jar url String external = baseURL.toExternalForm(); @@ -481,11 +465,11 @@ public class URLClassLoader extends SecureClassLoader */ final static class FileURLLoader extends URLLoader { - File dir; //the canonical file for this file url + File dir; //the file for this file url FileURLLoader(URLClassLoader classloader, URL url) { - super(classloader, getCanonicalFileURL(url)); + super(classloader, url); dir = new File(baseURL.getFile()); } @@ -493,13 +477,6 @@ public class URLClassLoader extends SecureClassLoader Resource getResource(String name) { File file = new File(dir, name); - try - { - file = file.getCanonicalFile(); - } - catch (IOException ignore) - { - } if (file.exists() && !file.isDirectory()) return new FileResource(this, name, file); return null; |