===== PATCH =====
diff --git a/src/java.base/share/classes/java/net/URLStreamHandler.java b/src/java.base/share/classes/java/net/URLStreamHandler.java
--- a/src/java.base/share/classes/java/net/URLStreamHandler.java
+++ b/src/java.base/share/classes/java/net/URLStreamHandler.java
@@ -266,8 +266,8 @@
spec.substring(start, limit);
} else {
- String separator = (authority != null) ? "/" : "";
- path = separator + spec.substring(start, limit);
+ path = spec.substring(start, limit);
+ path = (authority != null) ? "/" + path : path;
}
} else if (queryOnly && path != null) {
int ind = path.lastIndexOf('/');
Suggested by Christoph Dreis: https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-April/065635.html
diff --git a/src/java.base/share/classes/java/net/URLStreamHandler.java b/src/java.base/share/classes/java/net/URLStreamHandler.java
--- a/src/java.base/share/classes/java/net/URLStreamHandler.java
+++ b/src/java.base/share/classes/java/net/URLStreamHandler.java
@@ -266,8 +266,8 @@
spec.substring(start, limit);
} else {
- String separator = (authority != null) ? "/" : "";
- path = separator + spec.substring(start, limit);
+ path = spec.substring(start, limit);
+ path = (authority != null) ? "/" + path : path;
}
} else if (queryOnly && path != null) {
int ind = path.lastIndexOf('/');
Suggested by Christoph Dreis: https://mail.openjdk.java.net/pipermail/core-libs-dev/2020-April/065635.html