Program: 9788
Project: 9788
Buggy source:
public DynamicReport buildReport() throws Exception {
  Style detailStyle=new Style();
  Style headerStyle=new Style();
  headerStyle.setFont(Font.ARIAL_MEDIUM_BOLD);
  headerStyle.setBorder(Border.MEDIUM);
  headerStyle.setHorizontalAlign(HorizontalAlign.CENTER);
  headerStyle.setVerticalAlign(VerticalAlign.MIDDLE);
  Style titleStyle=new Style();
  titleStyle.setFont(new Font(18,Font._FONT_VERDANA,true));
  Style importeStyle=new Style();
  importeStyle.setHorizontalAlign(HorizontalAlign.RIGHT);
  Style oddRowStyle=new Style();
  oddRowStyle.setBorder(Border.NO_BORDER);
  oddRowStyle.setBackgroundColor(Color.LIGHT_GRAY);
  oddRowStyle.setTransparency(Transparency.OPAQUE);
  DynamicReportBuilder drb=new DynamicReportBuilder();
  Integer margin=new Integer(20);
  drb.addTitle("String_Node_Str").addTitleStyle(titleStyle).addSubtitle("String_Node_Str").addDetailHeight(new Integer(15)).addLeftMargin(margin).addRightMargin(margin).addTopMargin(margin).addBottomMargin(margin).addPrintBackgroundOnOddRows(true).addOddRowBackgroundStyle(oddRowStyle).addColumnsPerPage(new Integer(1)).addColumnSpace(new Integer(5));
  AbstractColumn columnState=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",String.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(85)).addStyle(detailStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnBranch=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",String.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(85)).addStyle(detailStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnaProductLine=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",String.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(85)).addStyle(detailStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnaItem=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",String.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(85)).addStyle(detailStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnCode=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",Long.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(40)).addStyle(importeStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnaQuantity=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",Long.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(80)).addStyle(importeStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnAmount=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",Float.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(90)).addPattern("String_Node_Str").addStyle(importeStyle).addHeaderStyle(headerStyle).build();
  GroupBuilder gb1=new GroupBuilder();
  ColumnsGroup g1=gb1.addCriteriaColumn((PropertyColumn)columnState).addFooterVariable(columnAmount,ColumnsGroupVariableOperation.SUM).addFooterVariable(columnaQuantity,ColumnsGroupVariableOperation.SUM).addGroupLayout(GroupLayout.VALUE_IN_HEADER_WITH_COLNAMES).build();
  GroupBuilder gb2=new GroupBuilder();
  ColumnsGroup g2=gb2.addCriteriaColumn((PropertyColumn)columnBranch).addFooterVariable(columnAmount,ColumnsGroupVariableOperation.SUM).addFooterVariable(columnaQuantity,ColumnsGroupVariableOperation.SUM).build();
  drb.addColumn(columnState);
  drb.addColumn(columnBranch);
  drb.addColumn(columnaProductLine);
  drb.addColumn(columnaItem);
  drb.addColumn(columnCode);
  drb.addColumn(columnaQuantity);
  drb.addColumn(columnAmount);
  drb.addGroup(g1);
  drb.addGroup(g2);
  drb.addUseFullPageWidth(true);
  DJChartBuilder cb=new DJChartBuilder();
  DJChart chart=cb.addType(DJChart.BAR_CHART).addOperation(DJChart.CALCULATION_SUM).addColumnsGroup(g1).addColumn(columnAmount).build();
  drb.addChart(chart);
  DynamicReport dr=drb.build();
  return dr;
}

Fixed version (ground truth):
public DynamicReport buildReport() throws Exception {
  Style detailStyle=new Style();
  Style headerStyle=new Style();
  headerStyle.setFont(Font.ARIAL_MEDIUM_BOLD);
  headerStyle.setBorder(Border.MEDIUM);
  headerStyle.setHorizontalAlign(HorizontalAlign.CENTER);
  headerStyle.setVerticalAlign(VerticalAlign.MIDDLE);
  Style titleStyle=new Style();
  titleStyle.setFont(new Font(18,Font._FONT_VERDANA,true));
  Style importeStyle=new Style();
  importeStyle.setHorizontalAlign(HorizontalAlign.RIGHT);
  Style oddRowStyle=new Style();
  oddRowStyle.setBorder(Border.NO_BORDER);
  oddRowStyle.setBackgroundColor(Color.LIGHT_GRAY);
  oddRowStyle.setTransparency(Transparency.OPAQUE);
  DynamicReportBuilder drb=new DynamicReportBuilder();
  Integer margin=new Integer(20);
  drb.addTitle("String_Node_Str").addTitleStyle(titleStyle).addSubtitle("String_Node_Str").addDetailHeight(new Integer(15)).addLeftMargin(margin).addRightMargin(margin).addTopMargin(margin).addBottomMargin(margin).addPrintBackgroundOnOddRows(true).addOddRowBackgroundStyle(oddRowStyle).addColumnsPerPage(new Integer(1)).addColumnSpace(new Integer(5));
  AbstractColumn columnState=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",String.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(85)).addStyle(detailStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnBranch=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",String.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(85)).addStyle(detailStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnaProductLine=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",String.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(85)).addStyle(detailStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnaItem=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",String.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(85)).addStyle(detailStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnCode=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",Long.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(40)).addStyle(importeStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnaQuantity=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",Long.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(80)).addStyle(importeStyle).addHeaderStyle(headerStyle).build();
  AbstractColumn columnAmount=ColumnBuilder.getInstance().addColumnProperty("String_Node_Str",Float.class.getName()).addTitle("String_Node_Str").addWidth(new Integer(90)).addPattern("String_Node_Str").addStyle(importeStyle).addHeaderStyle(headerStyle).build();
  GroupBuilder gb1=new GroupBuilder();
  ColumnsGroup g1=gb1.addCriteriaColumn((PropertyColumn)columnState).addFooterVariable(columnAmount,ColumnsGroupVariableOperation.SUM).addFooterVariable(columnaQuantity,ColumnsGroupVariableOperation.SUM).addGroupLayout(GroupLayout.VALUE_IN_HEADER_WITH_COLNAMES).build();
  GroupBuilder gb2=new GroupBuilder();
  ColumnsGroup g2=gb2.addCriteriaColumn((PropertyColumn)columnBranch).addFooterVariable(columnAmount,ColumnsGroupVariableOperation.SUM).addFooterVariable(columnaQuantity,ColumnsGroupVariableOperation.SUM).build();
  drb.addColumn(columnState);
  drb.addColumn(columnBranch);
  drb.addColumn(columnaProductLine);
  drb.addColumn(columnaItem);
  drb.addColumn(columnCode);
  drb.addColumn(columnaQuantity);
  drb.addColumn(columnAmount);
  drb.addGroup(g1);
  drb.addGroup(g2);
  drb.addUseFullPageWidth(true);
  DJChartBuilder cb=new DJChartBuilder();
  DJChart chart=cb.addType(DJChart.BAR_CHART).addOperation(DJChart.CALCULATION_SUM).addColumnsGroup(g2).addColumn(columnAmount).build();
  drb.addChart(chart);
  DynamicReport dr=drb.build();
  return dr;
}