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

Preserve module name in jdec output

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • asm_tools_6.0
    • tools
    • None
    • Fix Understood

      jdec output doesn't preserve the name of the module at the start of the
      declaration.

      Example:
      -------------------------------
      $ cat module-info.jcod
      module foo.bar {
        0xCAFEBABE;
        0; // minor version
        53; // version
        [] { // Constant Pool
          ; // first element is empty
          class #8; // #1
          Utf8 "SourceFile"; // #2
          Utf8 "module-info.java"; // #3
          Utf8 "Module"; // #4
          Module #9; // #5
          Module #10; // #6
          Utf8 "9-ea"; // #7
          Utf8 "module-info"; // #8
          Utf8 "foo.bar"; // #9
          Utf8 "java.base"; // #10
        } // Constant Pool

        0x8000; // access
        #1;// this_cpx
        #0;// super_cpx

        [] { // Interfaces
        } // Interfaces

        [] { // fields
        } // fields

        [] { // methods
        } // methods

        [] { // Attributes
          Attr(#2) { // SourceFile
            #3;
          } // end SourceFile
          ;
          Attr(#4) { // Module
            #5; // name_index
            0x0000; // flags
            #0; // version
            [] { // requires
              #6 0x8000 #7;
            } // requires

            [] { // exports
            } // exports

            [] { // opens
            } // opens

            [] { // uses
            } // uses

            [] { // provides
            } // provides

          } // end Module
        } // Attributes
      } // end module foo.bar
      $ java -jar asmtools.jar jcoder -d out module-info.jcod
      $ java -jar asmtools.jar jdec out/module-info.class > module-info.jcod.after
      $ diff module-info.jcod module-info.jcod.after
      1c1
      < module foo.bar {
      ---
      > module {
      -------------------------------

      Note that the module name in the end comment ("end module XXX") is
      preserved.

      The name given at the start of the module doesn't seem to have any effect on the .class output, but it would be nice to preserve it for readability reasons.

            lkuskov Leonid Kuskov
            slukyanov Stanislav Lukyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: