8343427: Class file load hook crashes on archived classes from multi-release JARs

Reviewed-by: dholmes, iklam
This commit is contained in:
Calvin Cheung 2024-11-26 17:14:00 +00:00
parent f1b5a6e66e
commit d752f19611
7 changed files with 239 additions and 1 deletions

View file

@ -1685,6 +1685,15 @@ public abstract class ClassLoader {
}
}
/**
* Called by VM for reading class bytes.
*/
private byte[] getResourceAsByteArray(String name) throws IOException {
Objects.requireNonNull(name);
InputStream is = getResourceAsStream(name);
return is != null ? is.readAllBytes() : null;
}
/**
* Open for reading, a resource of the specified name from the search path
* used to load classes. This method locates the resource through the