Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

include leading slash in path when parsing URLs in URLStreamHandler

This matches the behavior of OpenJDK's version.
  • Loading branch information...
commit 750e5f903c40072c5eff86a6c66376e1f33f0e9e 1 parent 999e90c
@dicej dicej authored
Showing with 2 additions and 3 deletions.
  1. +1 −1  classpath/java/net/URLStreamHandler.java
  2. +1 −2  test/UrlTest.java
View
2  classpath/java/net/URLStreamHandler.java
@@ -40,7 +40,7 @@ protected void parseURL(URL url, String s, int start, int end)
host = s.substring(0, colon);
port = Integer.parseInt(s.substring(colon + 1), slash);
}
- s = s.substring(slash + 1);
+ s = s.substring(slash);
}
}
View
3  test/UrlTest.java
@@ -3,7 +3,7 @@
public class UrlTest {
private static String query="var1=val1&var2=val2";
- private static String path="testpath";
+ private static String path="/testpath";
private static String domain="file://www.readytalk.com";
private static String file=path + "?" + query;
private static URL url;
@@ -15,7 +15,6 @@ private static void expect(boolean v) {
private static void setupURL() throws MalformedURLException {
StringBuilder builder = new StringBuilder();
builder.append(domain);
- builder.append("/");
builder.append(file);
url = new URL(builder.toString());
}
Please sign in to comment.
Something went wrong with that request. Please try again.