8308899: Introduce Classfile context and improve Classfile options

8306650: Improve control of stack maps generation in Classfile API
8308646: Typo in ConstantValueAttribute

Reviewed-by: mcimadamore
This commit is contained in:
Adam Sotona 2023-06-27 05:05:17 +00:00
parent 79c056ec8b
commit 990e3a700d
113 changed files with 1602 additions and 1190 deletions

View file

@ -1590,8 +1590,8 @@ public final class Module implements AnnotatedElement {
*/
private Class<?> loadModuleInfoClass(InputStream in) throws IOException {
final String MODULE_INFO = "module-info";
byte[] bytes = Classfile.parse(in.readAllBytes(),
Classfile.Option.constantPoolSharing(false)).transform((clb, cle) -> {
var cc = Classfile.of(Classfile.ConstantPoolSharingOption.NEW_POOL);
byte[] bytes = cc.transform(cc.parse(in.readAllBytes()), (clb, cle) -> {
switch (cle) {
case AccessFlags af -> clb.withFlags(AccessFlag.INTERFACE,
AccessFlag.ABSTRACT, AccessFlag.SYNTHETIC);