mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8308753: Class-File API transition to Preview
Reviewed-by: ihse, mchung, vromero
This commit is contained in:
parent
b9df827adc
commit
2b00ac0d02
681 changed files with 7518 additions and 6502 deletions
|
@ -25,20 +25,16 @@
|
|||
* @bug 8034854
|
||||
* @summary Verify that the InnerClasses attribute has outer_class_info_index zero if it has
|
||||
* inner_name_index zero (for synthetic classes)
|
||||
* @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
|
||||
* @compile SyntheticClasses.java
|
||||
* @run main SyntheticClasses
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import jdk.internal.classfile.*;
|
||||
import jdk.internal.classfile.attribute.*;
|
||||
import java.lang.classfile.*;
|
||||
import java.lang.classfile.attribute.*;
|
||||
|
||||
public class SyntheticClasses {
|
||||
|
||||
|
@ -49,7 +45,7 @@ public class SyntheticClasses {
|
|||
private void run() throws IOException {
|
||||
File testClasses = new File(System.getProperty("test.classes"));
|
||||
for (File classFile : Objects.requireNonNull(testClasses.listFiles(f -> f.getName().endsWith(".class")))) {
|
||||
ClassModel cf = Classfile.of().parse(classFile.toPath());
|
||||
ClassModel cf = ClassFile.of().parse(classFile.toPath());
|
||||
if (cf.thisClass().asInternalName().matches(".*\\$[0-9]+")) {
|
||||
EnclosingMethodAttribute encl = cf.findAttribute(Attributes.ENCLOSING_METHOD).orElse(null);
|
||||
if (encl != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue