8266109: More Resilient Classloading

Reviewed-by: lancea, rhalade, mschoene, bchristi
This commit is contained in:
Weijun Wang 2021-06-18 20:26:49 +00:00 committed by Henry Jen
parent a07a046c92
commit 3470e7b300
3 changed files with 27 additions and 0 deletions

View file

@ -427,6 +427,11 @@ public class URLClassLoader extends SecureClassLoader implements Closeable {
return defineClass(name, res);
} catch (IOException e) {
throw new ClassNotFoundException(name, e);
} catch (ClassFormatError e2) {
if (res.getDataError() != null) {
e2.addSuppressed(res.getDataError());
}
throw e2;
}
} else {
return null;