On 28/04/2016 19:53, Steve Drach wrote:
:
Yes, and for regular jar files, that worked fine, but when we tried it with a 
multi-release jar we found it by passed the part of JarLoader where we open the 
jar file as a runtime jar, so, for example, this code fails to retrieve the 
correct versioned entry, returning instead the base entry.

URL[] urls = { new URL(“jar:file:/foo/multi-release.jar!/“) };
URLClassLoader cldr = new URLClassLoader(urls);
Class<?> vcls = cldr.loadClass("version.Version”);

The change just corrects the logic when working with a “jar:…..!/“ URL.


Can you double check the URLClassLoader spec?

Also I assume the URL you are want here is "file:/foo/multi-release.jar" as "jar:file:/foo/multi-release.jar!/" is the URL to the top-level directory in the JAR file.

-Alan

Reply via email to