You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mnemonic.apache.org by "Tao Jie (JIRA)" <ji...@apache.org> on 2018/02/09 09:05:00 UTC

[jira] [Resolved] (MNEMONIC-459) Missing import statement in generated Durable class when it has fields of Durable Collection

     [ https://issues.apache.org/jira/browse/MNEMONIC-459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tao Jie resolved MNEMONIC-459.
------------------------------
    Resolution: Duplicate
      Assignee: Tao Jie  (was: Yanping Wang)

> Missing import statement in generated Durable class when it has fields of Durable Collection
> --------------------------------------------------------------------------------------------
>
>                 Key: MNEMONIC-459
>                 URL: https://issues.apache.org/jira/browse/MNEMONIC-459
>             Project: Mnemonic
>          Issue Type: Bug
>            Reporter: Tao Jie
>            Assignee: Tao Jie
>            Priority: Major
>
> 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}
> 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);
> {code}
> {{$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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)