Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7904065

Classfile version < 45 synthetic methods should not set ACC_SYNTHETIC

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • asm_tools_9.0
    • None
    • tools
    • None
    • b12

      When jasm processes files with classfile version <= 45, it shouldn't set the ACC_SYNTHETIC bit but add the Synthetic attribute instead. The ACC_SYNTHETIC bit wasn't introduced until classfile version 46.

      super class OuterClass$InnerClass
      version 45:3
      {

      private final synthetic Field this$0:"LOuterClass;";

      Method "<init>":"(LOuterClass;)V"
      stack 2 locals 2
      {
      aload_0;
      invokespecial Method java/lang/Object."<init>":"()V";
      aload_0;
      aload_1;
      putfield Field this$0:"LOuterClass;";
      return;
      }

      InnerClass InnerClass=class OuterClass$InnerClass of class OuterClass;

      } // end Class OuterClass$InnerClass

      super class OuterClass
      version 45:3
      {


      Method "<init>":"()V"
      stack 1 locals 1
      {
      aload_0;
      invokespecial Method java/lang/Object."<init>":"()V";
      return;
      }

      InnerClass InnerClass=class OuterClass$InnerClass of class OuterClass;

      } // end Class OuterClass

      jasm makes this$0 synthetic field ACC_SYNTHETIC but is should use the Synthetic attribute instead

          Utf8 "this$0"; // #17

        [] { // Fields
          { // field
            0x1012; // access
            #17; // name_index
            #8; // descriptor_index
            [] { // Attributes
            } // Attributes
          }
        } // Fields

            lkuskov Leonid Kuskov
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: