Skip to content

Commit

Permalink
builders should reset state after build
Browse files Browse the repository at this point in the history
  • Loading branch information
tinhol committed Nov 6, 2015
1 parent 0f736a5 commit c25ec7f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public BandBuilder orientation(BandOrientation orientation) {

public ReportBand build() {
bandDefinition.validate();
return bandDefinition;
ReportBandImpl result = bandDefinition;
bandDefinition = new ReportBandImpl();
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public ReportBuilder name(String name) {

public Report build() {
report.validate();
return report;
ReportImpl result = report;
report = new ReportImpl();
return result;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public ReportTemplateBuilder custom(CustomReport customReport) {

public ReportTemplate build() {
reportTemplate.validate();
return reportTemplate;
ReportTemplateImpl result = reportTemplate;
reportTemplate = new ReportTemplateImpl();
return result;
}
}

0 comments on commit c25ec7f

Please sign in to comment.