Program: 70276
Project: 70276
Buggy source:
public void visitReportDesign(ReportDesignHandle handle){
  setupNamedExpressions(handle,report.getNamedExpressions());
  StyleHandle defaultStyle=handle.findStyle("String_Node_Str");
  createReportDefaultStyles(defaultStyle);
  PageSetupDesign pageSetup=new PageSetupDesign();
  SlotHandle pageSlot=handle.getMasterPages();
  for (int i=0; i < pageSlot.getCount(); i++) {
    apply(pageSlot.get(i));
    if (currentElement != null) {
      pageSetup.addMasterPage((MasterPageDesign)currentElement);
    }
  }
  if (pageSlot.getCount() < 1) {
    MasterPageDesign masterPage=new SimpleMasterPageDesign();
    masterPage.setID(generateUniqueID());
    masterPage.setName(DEFAULT_MASTERPAGE_NAME);
    masterPage.setPageType(DesignChoiceConstants.PAGE_SIZE_US_LETTER);
    masterPage.setOrientation(DesignChoiceConstants.PAGE_ORIENTATION_AUTO);
    DimensionType top=new DimensionType(DEFAULT_MASTERPAGE_TOP_MARGIN,DimensionType.UNITS_IN);
    DimensionType left=new DimensionType(DEFAULT_MASTERPAGE_LEFT_MARGIN,DimensionType.UNITS_IN);
    DimensionType bottom=new DimensionType(DEFAULT_MASTERPAGE_BOTTOM_MARGIN,DimensionType.UNITS_IN);
    DimensionType right=new DimensionType(DEFAULT_MASTERPAGE_RIGHT_MARGIN,DimensionType.UNITS_IN);
    masterPage.setMargin(top,left,bottom,right);
    pageSetup.addMasterPage(masterPage);
  }
  report.setPageSetup(pageSetup);
  SlotHandle bodySlot=handle.getBody();
  for (int i=0; i < bodySlot.getCount(); i++) {
    apply(bodySlot.get(i));
    if (currentElement != null) {
      report.addContent((ReportItemDesign)currentElement);
    }
  }
}

Fixed version (ground truth):
public void visitReportDesign(ReportDesignHandle handle){
  setupNamedExpressions(handle,report.getNamedExpressions());
  StyleHandle defaultStyle=handle.findStyle("String_Node_Str");
  createReportDefaultStyles(defaultStyle);
  PageSetupDesign pageSetup=new PageSetupDesign();
  SlotHandle pageSlot=handle.getMasterPages();
  for (int i=0; i < pageSlot.getCount(); i++) {
    apply(pageSlot.get(i));
    if (currentElement != null) {
      pageSetup.addMasterPage((MasterPageDesign)currentElement);
    }
  }
  if (pageSlot.getCount() < 1) {
    MasterPageDesign masterPage=new SimpleMasterPageDesign();
    masterPage.setID(generateUniqueID());
    masterPage.setName(DEFAULT_MASTERPAGE_NAME);
    masterPage.setPageType(DesignChoiceConstants.PAGE_SIZE_US_LETTER);
    masterPage.setOrientation(DesignChoiceConstants.PAGE_ORIENTATION_AUTO);
    DimensionType width=new DimensionType(DEFAULT_MASTERPAGE_WIDTH,DimensionType.UNITS_IN);
    DimensionType height=new DimensionType(DEFAULT_MASTERPAGE_HEIGHT,DimensionType.UNITS_IN);
    masterPage.setPageSize(width,height);
    DimensionType top=new DimensionType(DEFAULT_MASTERPAGE_TOP_MARGIN,DimensionType.UNITS_IN);
    DimensionType left=new DimensionType(DEFAULT_MASTERPAGE_LEFT_MARGIN,DimensionType.UNITS_IN);
    DimensionType bottom=new DimensionType(DEFAULT_MASTERPAGE_BOTTOM_MARGIN,DimensionType.UNITS_IN);
    DimensionType right=new DimensionType(DEFAULT_MASTERPAGE_RIGHT_MARGIN,DimensionType.UNITS_IN);
    masterPage.setMargin(top,left,bottom,right);
    pageSetup.addMasterPage(masterPage);
  }
  report.setPageSetup(pageSetup);
  SlotHandle bodySlot=handle.getBody();
  for (int i=0; i < bodySlot.getCount(); i++) {
    apply(bodySlot.get(i));
    if (currentElement != null) {
      report.addContent((ReportItemDesign)currentElement);
    }
  }
}