8331291: java.lang.classfile.Attributes class performs a lot of static initializations

Reviewed-by: liach, redestad, vromero
This commit is contained in:
Adam Sotona 2024-05-24 15:58:34 +00:00
parent 0c934ff4e2
commit cfdc64fcb4
149 changed files with 1669 additions and 1323 deletions

View file

@ -67,7 +67,7 @@ public class TestDefaultBody {
MethodModel testMethod = null;
CodeAttribute codeAttr = null;
for (MethodModel m : cf.methods()) {
codeAttr = m.findAttribute(Attributes.CODE).orElse(null);
codeAttr = m.findAttribute(Attributes.code()).orElse(null);
String mname = m.methodName().stringValue();
if (mname.equals(TEST_METHOD_NAME)) {
testMethod = m;

View file

@ -86,7 +86,7 @@ public class TestDirectSuperInterfaceInvoke {
try {
final ClassModel cf = ClassFile.of().parse(file.toPath());
for (MethodModel m : cf.methods()) {
CodeAttribute codeAttr = m.findAttribute(Attributes.CODE).orElseThrow();
CodeAttribute codeAttr = m.findAttribute(Attributes.code()).orElseThrow();
for (CodeElement ce : codeAttr.elementList()) {
if (ce instanceof InvokeInstruction instr && instr.opcode() == Opcode.INVOKESPECIAL) {
MemberRefEntry ref = instr.method();