Uploaded image for project: 'Mnemonic'
  1. Mnemonic
  2. MNEMONIC-459

Missing import statement in generated Durable class when it has fields of Durable Collection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      When we define a type with DurableCollection fields (eg: DurableArray), the generated class has compilation error that missing import statement :import org.apache.mnemonic.collections.DurableArrayFactory;
      In javapoet, import statement is created automatically once we add a type in statement. However in AnnotatedDurableEntityClass.buildGettersSpecs:

      code.addStatement("$1N = $5N.restore($2N, $6L, $7L, phandler, $3N, $4N)", dynfieldinfo.name, allocname, autoreclaimname, reclaimctxname, String.format("%s%s", m_typeutils.asElement(methodinfo.elem.getReturnType()).getSimpleName(), cFACTORYNAMESUFFIX), dynfieldinfo.efproxiesname, dynfieldinfo.gftypesname);
      

      $5N here is DurableArrayFactory, but it is treated as a variable rather than a type, as a result, it would not be added to the import statement.

      Attachments

        Issue Links

          Activity

            People

              Tao Jie Tao Jie
              Tao Jie Tao Jie
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: