Mercurial > hg > release > icedtea-web-1.8
changeset 1522:f211a6ffffe0
Fixed PR3637 - making cache work with jdk9+ #runtime jar url anchor
* netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java: (retrieve) if jar is not found in cache, ale url without anchor is attempted
* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: usinf localFile.toURI().toURL() instead of direct localFile.toURL()
author | Jiri Vanek <jvanek@redhat.com> |
---|---|
date | Tue, 27 Nov 2018 13:26:48 +0100 |
parents | 6b6da5f22c26 |
children | 77e21cdc1813 |
files | ChangeLog netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java |
diffstat | 3 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Nov 23 15:33:01 2018 +0100 +++ b/ChangeLog Tue Nov 27 13:26:48 2018 +0100 @@ -1,3 +1,10 @@ +2018-11-27 Jiri Vanek <jvanek@redhat.com> + Lars Herschke <lhersch@dssgmbh.de> + + Fixed PR3637 - making cache work with jdk9+ #runtime jar url anchor + * netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java: (retrieve) if jar is not found in cache, ale url without anchor is attempted + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java: usinf localFile.toURI().toURL() instead of direct localFile.toURL() + 2018-11-23 Lars Herschke <lhersch@dssgmbh.de> Jiri Vanek <jvanek@redhat.com>
--- a/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java Fri Nov 23 15:33:01 2018 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java Tue Nov 27 13:26:48 2018 +0100 @@ -86,6 +86,12 @@ @Override public java.util.jar.JarFile retrieve(URL url) throws IOException { URL localUrl = mapping.get(url); + if (localUrl == null) { + if (url.getRef() != null) { + url = new URL(url.toString().substring(0, url.toString().lastIndexOf(url.getRef()) - 1)); + localUrl = mapping.get(url); + } + } if (localUrl == null) { /*
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Nov 23 15:33:01 2018 +0100 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Tue Nov 27 13:26:48 2018 +0100 @@ -1401,7 +1401,7 @@ // there is currently no mechanism to cache files per // instance.. so only index cached files if (localFile != null) { - CachedJarFileCallback.getInstance().addMapping(jar.getLocation(), localFile.toURL()); + CachedJarFileCallback.getInstance().addMapping(jar.getLocation(), localFile.toURI().toURL()); try (JarFile jarFile = new JarFile(localFile.getAbsolutePath())) { Manifest mf = jarFile.getManifest();