New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom generics error #101

Closed
xvipservice opened this Issue Jul 14, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@xvipservice

xvipservice commented Jul 14, 2016

i hava a common class like this.

public class PageList<T> {
    private List<T> list;
    private PageInfo pageInfo;

    public PageList() {
    }

    public PageList(PageInfo pageInfo) {
        this.pageInfo = pageInfo;
    }

    public PageList(int pageIndex, int pageSize, int totalCount) {
        this(new PageInfo(pageIndex, pageSize, totalCount));
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public PageInfo getPageInfo() {
        return pageInfo;
    }

    public void setPageInfo(PageInfo pageInfo) {
        this.pageInfo = pageInfo;
    }
}

and i have a mapper like this

@Mapper(withIgnoreMissing = IgnoreMissing.ALL,withCollectionStrategy = ALLOW_GETTER)
public interface IFormDesignMapper{
    PageList<FormDesignDto> asFormDesignDto(PageList<FormDesignDomain> in);
    List<FormDesignDomain> asFormDesignDomain(List<FormDesignDto> in);
    FormDesignDto asFormDesignDto(FormDesignDomain in);
    FormDesignDomain asFormDesignDomain(FormDesignDto in);
}

and the generate code is wrong!

  @Override
  public final gaeaera.model.common.PageList<gaea.workflow.dto.FormDesignDto> asFormDesignDto(gaeaera.model.common.PageList<gaea.workflow.domain.core.FormDesignDomain> in) {
    gaeaera.model.common.PageList<gaea.workflow.dto.FormDesignDto> out = null;
    if (in != null) {
      out = new gaeaera.model.common.PageList<gaea.workflow.dto.FormDesignDto>();
      if (in.getList() != null) {
        java.util.ArrayList<T> alistTmpCollection = new java.util.ArrayList<T>(in.getList().size());
        for (T alistItem : in.getList()) {
        }
        out.setList(alistTmpCollection);
      }
      else {
        out.setList(null);
      }
      out.setPageInfo(asPageInfo(in.getPageInfo()));
    }
    return out;
  }

@slemesle slemesle added the bug label Jul 15, 2016

@slemesle slemesle added this to the 0.15 milestone Jul 15, 2016

slemesle added a commit that referenced this issue Jul 15, 2016

@slemesle

This comment has been minimized.

Show comment
Hide comment
@slemesle

slemesle Jul 15, 2016

Thanks for the report, the bug is fixed with an integration test to check it.
It will be available in snapshot build quickly.

slemesle commented Jul 15, 2016

Thanks for the report, the bug is fixed with an integration test to check it.
It will be available in snapshot build quickly.

@slemesle slemesle closed this Jul 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment