8294378: URLPermission constructor exception when using tr locale

Reviewed-by: dfuchs, jpai, aefimov
This commit is contained in:
Ryan Wallace 2022-11-12 01:37:46 +00:00 committed by Jaikiran Pai
parent 34a499de8e
commit ff2c987669
3 changed files with 13 additions and 5 deletions

View file

@ -31,6 +31,7 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import java.security.Permission;
import java.util.Locale;
/**
* Represents permission to access a resource or set of resources defined by a
@ -471,7 +472,7 @@ public final class URLPermission extends Permission {
throw new IllegalArgumentException(
"Invalid URL string: \"" + url + "\"");
}
scheme = url.substring(0, delim).toLowerCase();
scheme = url.substring(0, delim).toLowerCase(Locale.ROOT);
this.ssp = url.substring(delim + 1);
if (!ssp.startsWith("//")) {
@ -493,7 +494,7 @@ public final class URLPermission extends Permission {
auth = authpath.substring(0, delim);
this.path = authpath.substring(delim);
}
this.authority = new Authority(scheme, auth.toLowerCase());
this.authority = new Authority(scheme, auth);
}
private String actions() {