8262277: URLClassLoader.getResource throws undocumented IllegalArgumentException

Reviewed-by: alanb, bchristi, psadhukhan
This commit is contained in:
Craig Andrews 2021-03-15 18:35:04 +00:00 committed by Brent Christian
parent 4f1cda4fd7
commit 0c718ab2a0
2 changed files with 60 additions and 3 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -600,7 +600,7 @@ public class URLClassPath {
try {
url = new URL(base, ParseUtil.encodePath(name, false));
} catch (MalformedURLException e) {
throw new IllegalArgumentException("name");
return null;
}
try {
@ -636,7 +636,7 @@ public class URLClassPath {
try {
url = new URL(base, ParseUtil.encodePath(name, false));
} catch (MalformedURLException e) {
throw new IllegalArgumentException("name");
return null;
}
final URLConnection uc;
try {