< prev index next >

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

Print this page
@@ -42,10 +42,15 @@
  
      private void run() throws IOException, ConstantPoolException {
          File testClasses = new File(System.getProperty("test.classes"));
          for (File classFile : testClasses.listFiles(f -> f.getName().endsWith(".class"))) {
              ClassFile cf = ClassFile.read(classFile);
+             if ((cf.access_flags.flags & (AccessFlags.ACC_SYNTHETIC | AccessFlags.ACC_VALUE | AccessFlags.ACC_ABSTRACT)) == AccessFlags.ACC_SYNTHETIC) {
+                 if ((cf.access_flags.flags & AccessFlags.ACC_IDENTITY) == 0) {
+                     throw new IllegalStateException("Missing ACC_IDENTITY on synthetic concrete identity class: " + cf.getName());
+                 }
+             }
              if (cf.getName().matches(".*\\$[0-9]+")) {
                  EnclosingMethod_attribute encl =
                          (EnclosingMethod_attribute) cf.getAttribute(Attribute.EnclosingMethod);
                  if (encl != null) {
                      if (encl.method_index != 0)
< prev index next >