8242186: Reduce allocations in URLStreamHandler.parseURL for some cases

Reviewed-by: redestad, chegar
This commit is contained in:
Christoph Dreis 2020-04-06 13:44:54 +02:00 committed by Claes Redestad
parent 722a18d31e
commit e9adf7bbe1

@ -266,8 +266,8 @@ public abstract class URLStreamHandler {
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('/');