8151339: Adding fragment to JAR URLs breaks ant

Reviewed-by: alanb
This commit is contained in:
Steve Drach 2016-03-07 19:37:10 +00:00
parent ed0eef5c6b
commit e2181b48a5

View File

@ -758,9 +758,13 @@ public class URLClassPath {
final URL url;
try {
// add #runtime fragment to tell JarURLConnection to use
// runtime versioning if the underlying jar file is multi-release
url = new URL(getBaseURL(), ParseUtil.encodePath(name, false) + "#runtime");
if (jar.isMultiRelease()) {
// add #runtime fragment to tell JarURLConnection to use
// runtime versioning if the underlying jar file is multi-release
url = new URL(getBaseURL(), ParseUtil.encodePath(name, false) + "#runtime");
} else {
url = new URL(getBaseURL(), ParseUtil.encodePath(name, false));
}
if (check) {
URLClassPath.check(url);
}