< prev index next >

test/langtools/tools/javac/classfiles/InnerClasses/SyntheticClasses.java

Print this page
*** 44,10 ***
--- 44,15 ---
  
      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());
+             if ((cf.flags().flagsMask() & (ClassFile.ACC_SYNTHETIC | ClassFile.ACC_ABSTRACT)) == ClassFile.ACC_SYNTHETIC) {
+                 if ((cf.flags().flagsMask() & ClassFile.ACC_IDENTITY) == 0) {
+                     throw new IllegalStateException("Missing ACC_IDENTITY on synthetic concrete identity class: " + cf.thisClass().asInternalName());
+                 }
+             }
              if (cf.thisClass().asInternalName().matches(".*\\$[0-9]+")) {
                  EnclosingMethodAttribute encl = cf.findAttribute(Attributes.enclosingMethod()).orElse(null);
                  if (encl != null) {
                      if (encl.enclosingMethodName().isPresent())
                          throw new IllegalStateException("Invalid EnclosingMethod.method: " +
< prev index next >