8308753: Class-File API transition to Preview

Reviewed-by: ihse, mchung, vromero
This commit is contained in:
Adam Sotona 2023-12-04 07:07:57 +00:00
parent b9df827adc
commit 2b00ac0d02
681 changed files with 7518 additions and 6502 deletions

View file

@ -26,12 +26,8 @@
* @bug 8129547
* @summary Excess entries in BootstrapMethods with the same (bsm, bsmKind, bsmStaticArgs), but different dynamicArgs
* @library /tools/javac/lib
* @modules java.base/jdk.internal.classfile
* java.base/jdk.internal.classfile.attribute
* java.base/jdk.internal.classfile.constantpool
* java.base/jdk.internal.classfile.instruction
* java.base/jdk.internal.classfile.components
* java.base/jdk.internal.classfile.impl
* @enablePreview
* @modules java.base/jdk.internal.classfile.impl
* jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.code
* jdk.compiler/com.sun.tools.javac.jvm
@ -57,8 +53,8 @@ import com.sun.source.util.TaskEvent;
import com.sun.source.util.TaskListener;
import com.sun.source.util.TreeScanner;
import jdk.internal.classfile.*;
import jdk.internal.classfile.attribute.BootstrapMethodsAttribute;
import java.lang.classfile.*;
import java.lang.classfile.attribute.BootstrapMethodsAttribute;
import com.sun.tools.javac.api.JavacTaskImpl;
import com.sun.tools.javac.code.Symbol;
@ -115,7 +111,7 @@ public class TestBootstrapMethodsCount {
void verifyBytecode() {
File compiledTest = new File("Test.class");
try {
ClassModel cf = Classfile.of().parse(compiledTest.toPath());
ClassModel cf = ClassFile.of().parse(compiledTest.toPath());
BootstrapMethodsAttribute bsm_attr = cf.findAttribute(Attributes.BOOTSTRAP_METHODS).orElseThrow();
int length = bsm_attr.bootstrapMethodsSize();
if (length != 1) {