diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gnu/java/net/loader/JarURLLoader.java | 12 |
2 files changed, 8 insertions, 9 deletions
@@ -1,3 +1,8 @@ +2006-05-18 Jeroen Frijters <jeroen@frijters.net> + + * gnu/java/net/loader/JarURLLoader.java + (JarURLLoader): Use a slightly more efficient URL constructor. + 2006-05-18 David Gilbert <david.gilbert@object-refinery.com> * gnu/java/awt/print/JavaPrinterGraphics.java diff --git a/gnu/java/net/loader/JarURLLoader.java b/gnu/java/net/loader/JarURLLoader.java index aebd4a89e..e07b87b0d 100644 --- a/gnu/java/net/loader/JarURLLoader.java +++ b/gnu/java/net/loader/JarURLLoader.java @@ -32,20 +32,14 @@ public final class JarURLLoader extends URLLoader { super(classloader, cache, factory, baseURL, absoluteUrl); - // Cache url prefix for all resources in this jar url. - String external = baseURL.toExternalForm(); - StringBuffer sb = new StringBuffer(external.length() + 6); - sb.append("jar:"); - sb.append(external); - sb.append("!/"); - String jarURL = sb.toString(); - this.classPath = null; URL baseJarURL = null; JarFile jarfile = null; try { - baseJarURL = new URL(null, jarURL, cache.get(factory, "jar")); + // Cache url prefix for all resources in this jar url. + String base = baseURL.toExternalForm() + "!/"; + baseJarURL = new URL("jar", "", -1, base, cache.get(factory, "jar")); jarfile = ((JarURLConnection) baseJarURL.openConnection()).getJarFile(); |