StimVinsh / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

Circular references in model classes #117

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I created two related class - Child and Parent:

   class Child{
       private Parent parent;
       public Child(){
       }
       public void setParent(Parent parent) {
           this.parent = parent;
       }
       public Parent getParent() {
           return parent;
       }
   }

   class Parent{
       private List<Child> childList;
       public Parent(){

       }
       public void setChildList(List<Child> childList) {
           this.childList = childList;
       }
       public List<Child> getChildList() {
           return childList;
       }
   }

Then I try to call a FieldsMetadata.load() method for class "Parent"
and get an exception "java.lang.StackOverflowError":

InputStream in = App.class.getResourceAsStream("test.docx");
IXDocReport report = XDocReportRegistry.getRegistry().loadReport(
in,TemplateEngineKind.Velocity);
FieldsMetadata fieldsMetadata = report.createFieldsMetadata();
fieldsMetadata.load("parent", Parent.class); // <<<<< Stack overflow

Original issue reported on code.google.com by vao...@gmail.com on 23 May 2012 at 5:47

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by pascal.leclercq on 4 Jun 2012 at 12:10

GoogleCodeExporter commented 8 years ago

Original comment by pascal.leclercq on 4 Jun 2012 at 12:10

GoogleCodeExporter commented 8 years ago

Original comment by pascal.leclercq on 5 Jul 2012 at 10:03