mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8344908: URLClassPath should not propagate IllegalArgumentException when finding resources in classpath URLs
Reviewed-by: alanb
This commit is contained in:
parent
ce9d543eb1
commit
81c44e5eb4
5 changed files with 225 additions and 22 deletions
|
@ -903,7 +903,11 @@ public class URLClassPath {
|
|||
private FileLoader(URL url) throws IOException {
|
||||
super(url);
|
||||
String path = url.getFile().replace('/', File.separatorChar);
|
||||
path = ParseUtil.decode(path);
|
||||
try {
|
||||
path = ParseUtil.decode(path);
|
||||
} catch (IllegalArgumentException iae) {
|
||||
throw new IOException(iae);
|
||||
}
|
||||
dir = (new File(path)).getCanonicalFile();
|
||||
@SuppressWarnings("deprecation")
|
||||
var _unused = normalizedBase = new URL(getBaseURL(), ".");
|
||||
|
|
|
@ -171,6 +171,7 @@ public final class ParseUtil {
|
|||
* Returns a new String constructed from the specified String by replacing
|
||||
* the URL escape sequences and UTF8 encoding with the characters they
|
||||
* represent.
|
||||
* @throws IllegalArgumentException if {@code s} could not be decoded
|
||||
*/
|
||||
public static String decode(String s) {
|
||||
int n = s.length();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue