8151339: Adding fragment to JAR URLs breaks ant
authorsdrach
Mon, 07 Mar 2016 19:37:10 +0000
changeset 36251 e909478d3e1d
parent 36250 b1831ac3db35
child 36252 f66a8dabc67b
8151339: Adding fragment to JAR URLs breaks ant Reviewed-by: alanb
jdk/src/java.base/share/classes/sun/misc/URLClassPath.java
--- a/jdk/src/java.base/share/classes/sun/misc/URLClassPath.java	Mon Mar 07 10:11:59 2016 -0500
+++ b/jdk/src/java.base/share/classes/sun/misc/URLClassPath.java	Mon Mar 07 19:37:10 2016 +0000
@@ -758,9 +758,13 @@
 
             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);
                 }