nus-yam/ex-repair huggingface dataset:
Program: 69499
Project: 69499
Buggy source:
protected void resize(){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  int value=getMouseTrueValueX();
  part.getTableAdapter().transStar(RESIZE_COLUMN_TRANS_LABEL);
  if (isresizeMultipleColumn()) {
    List list=filterEditPart(part.getViewer().getSelectedEditParts());
    boolean resizeTable=false;
    int width=0;
    for (int i=0; i < list.size(); i++) {
      int tempValue=value;
      Object model=((EditPart)list.get(i)).getModel();
      ColumnHandleAdapter adapter=HandleAdapterFactory.getInstance().getColumnHandleAdapter(model);
      int start=adapter.getColumnNumber();
      int end=start + 1;
      int ori=TableUtil.caleVisualWidth(part,model);
      int adjustWidth=TableUtil.caleVisualWidth(part,part.getColumn(getStart())) + value;
      if (getStart() != start) {
        tempValue=adjustWidth - ori;
      }
      if (start == part.getColumnCount()) {
        end=start;
        resizeTable=true;
      }
 else {
        width=width + getTrueValue(tempValue,start,end);
      }
      resizeColumn(tempValue,start,end);
    }
    if (resizeTable) {
      Dimension size=part.getTableAdapter().getSize();
      try {
        part.getTableAdapter().setSize(new Dimension(size.width + width,-1));
      }
 catch (      SemanticException e) {
        part.getTableAdapter().rollBack();
        ExceptionHandler.handle(e);
      }
    }
  }
 else {
    resizeColumn(value,getStart(),getEnd());
  }
  part.getTableAdapter().transEnd();
}

Fixed version (ground truth):
protected void resize(){
  TableEditPart part=(TableEditPart)getSourceEditPart();
  int value=getMouseTrueValueX();
  part.getTableAdapter().transStar(RESIZE_COLUMN_TRANS_LABEL);
  if (isresizeMultipleColumn() && isCtrlDown()) {
    List list=filterEditPart(part.getViewer().getSelectedEditParts());
    boolean resizeTable=false;
    int width=0;
    for (int i=0; i < list.size(); i++) {
      int tempValue=value;
      Object model=((EditPart)list.get(i)).getModel();
      ColumnHandleAdapter adapter=HandleAdapterFactory.getInstance().getColumnHandleAdapter(model);
      int start=adapter.getColumnNumber();
      int end=start + 1;
      int ori=TableUtil.caleVisualWidth(part,model);
      int adjustWidth=TableUtil.caleVisualWidth(part,part.getColumn(getStart())) + value;
      if (getStart() != start) {
        tempValue=adjustWidth - ori;
      }
      if (start == part.getColumnCount()) {
        end=start;
        resizeTable=true;
      }
 else {
        width=width + getTrueValue(tempValue,start,end);
      }
      resizeColumn(tempValue,start,end);
    }
    if (resizeTable) {
      Dimension size=part.getTableAdapter().getSize();
      try {
        part.getTableAdapter().setSize(new Dimension(size.width + width,-1));
      }
 catch (      SemanticException e) {
        part.getTableAdapter().rollBack();
        ExceptionHandler.handle(e);
      }
    }
  }
 else {
    resizeColumn(value,getStart(),getEnd());
  }
  part.getTableAdapter().transEnd();
}
Program: 69500
Project: 69500
Buggy source:
@Override protected void fitResize(){
  List exclusion=new ArrayList();
  CrosstabTableEditPart part=(CrosstabTableEditPart)getSourceEditPart().getParent();
  int value=getMouseTrueValueX();
  CommandStack stack=part.getCrosstabHandleAdapter().getCrosstabItemHandle().getModuleHandle().getCommandStack();
  stack.startTrans(RESIZE_COLUMN_TRANS_LABEL);
  int width=0;
  exclusion.add(Integer.valueOf(getStart()));
  width=width + getTrueValue(value,getStart(),getEnd());
  resizeFixColumn(getTrueValue(value),getStart(),getEnd());
  Dimension tableSize=part.getFigure().getSize();
  part.getCrosstabHandleAdapter().setWidth(converPixToDefaultUnit(tableSize.width + width),getDefaultUnits());
  adjustOthersColumn(exclusion);
  stack.commit();
}

Fixed version (ground truth):
@Override protected void fitResize(){
  List exclusion=new ArrayList();
  CrosstabTableEditPart part=(CrosstabTableEditPart)getSourceEditPart().getParent();
  int value=getMouseTrueValueX();
  CommandStack stack=part.getCrosstabHandleAdapter().getCrosstabItemHandle().getModuleHandle().getCommandStack();
  stack.startTrans(RESIZE_COLUMN_TRANS_LABEL);
  int width=0;
  exclusion.add(Integer.valueOf(getStart()));
  width=width + getTrueValue(value,getStart(),getEnd());
  resizeFixColumn(getTrueValue(value),getStart(),getEnd());
  if (!isCtrlDown()) {
    exclusion.add(Integer.valueOf(getEnd()));
    if (getStart() != getEnd()) {
      width=0;
    }
  }
  Dimension tableSize=part.getFigure().getSize();
  part.getCrosstabHandleAdapter().setWidth(converPixToDefaultUnit(tableSize.width + width),getDefaultUnits());
  adjustOthersColumn(exclusion);
  stack.commit();
}
Program: 69501
Project: 69501
Buggy source:
/** 
 * Resets size of column.
 * @param start
 * @param end
 * @param value
 */
public void resizeColumn(int start,int end,int value){
  CrosstabTableEditPart part=(CrosstabTableEditPart)getSourceEditPart().getParent();
  CrosstabHandleAdapter crosstabAdapter=part.getCrosstabHandleAdapter();
  int startWidth=0;
  int endWidth=0;
  startWidth=CrosstabTableUtil.caleVisualWidth(part,start);
  crosstabAdapter.setColumnWidth(start,startWidth + value);
}

Fixed version (ground truth):
/** 
 * Resets size of column.
 * @param start
 * @param end
 * @param value
 */
public void resizeColumn(int start,int end,int value){
  CrosstabTableEditPart part=(CrosstabTableEditPart)getSourceEditPart().getParent();
  CrosstabHandleAdapter crosstabAdapter=part.getCrosstabHandleAdapter();
  int startWidth=0;
  int endWidth=0;
  startWidth=CrosstabTableUtil.caleVisualWidth(part,start);
  endWidth=CrosstabTableUtil.caleVisualWidth(part,end);
  crosstabAdapter.setColumnWidth(start,startWidth + value);
  if (!isCtrlDown() && start != end) {
    crosstabAdapter.setColumnWidth(end,endWidth - value);
  }
}
Program: 69502
Project: 69502
Buggy source:
protected void adjustOthersColumn(List exclusion){
  AbstractTableEditPart part=getAbstractTableEditPart();
  WorkingData data=getTableWorkingData();
  ColumnData[] datas=data.columnWidths;
  if (datas == null) {
    return;
  }
  for (int i=0; i < datas.length; i++) {
    if (exclusion.contains(Integer.valueOf(datas[i].columnNumber))) {
      continue;
    }
    ITableLayoutOwner.DimensionInfomation dim=part.getColumnWidth(datas[i].columnNumber);
    if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(dim.getUnits())) {
      resizeFixColumn(0,datas[i].columnNumber,1);
    }
 else     if (dim.getUnits() == null || dim.getUnits().length() == 0) {
      resizeFixColumn(0,datas[i].columnNumber,1);
    }
  }
}

Fixed version (ground truth):
protected void adjustOthersColumn(List exclusion){
  AbstractTableEditPart part=getAbstractTableEditPart();
  WorkingData data=getTableWorkingData();
  ColumnData[] datas=data.columnWidths;
  if (datas == null) {
    return;
  }
  for (int i=0; i < datas.length; i++) {
    if (exclusion.contains(Integer.valueOf(datas[i].columnNumber))) {
      continue;
    }
    ITableLayoutOwner.DimensionInfomation dim=part.getColumnWidth(datas[i].columnNumber);
    if (DesignChoiceConstants.UNITS_PERCENTAGE.equals(dim.getUnits())) {
      resizeFixColumn(0,datas[i].columnNumber,1);
    }
 else     if (dim.getUnits() == null || dim.getUnits().length() == 0) {
      resizeFixColumn(0,datas[i].columnNumber,datas[i].columnNumber);
    }
  }
}
Program: 69503
Project: 69503
Buggy source:
private void resizeFixColumn(int value,int start,int end){
  CrosstabTableEditPart part=(CrosstabTableEditPart)getSourceEditPart().getParent();
  CrosstabHandleAdapter crosstabAdapter=part.getCrosstabHandleAdapter();
  int startWidth=0;
  startWidth=CrosstabTableUtil.caleVisualWidth(part,start);
  crosstabAdapter.setColumnWidth(start,converPixToDefaultUnit(startWidth + value),getDefaultUnits());
}

Fixed version (ground truth):
private void resizeFixColumn(int value,int start,int end){
  CrosstabTableEditPart part=(CrosstabTableEditPart)getSourceEditPart().getParent();
  CrosstabHandleAdapter crosstabAdapter=part.getCrosstabHandleAdapter();
  int startWidth=0;
  int endWidth=0;
  startWidth=CrosstabTableUtil.caleVisualWidth(part,start);
  endWidth=CrosstabTableUtil.caleVisualWidth(part,end);
  crosstabAdapter.setColumnWidth(start,converPixToDefaultUnit(startWidth + value),getDefaultUnits());
  if (!isCtrlDown() && start != end) {
    crosstabAdapter.setColumnWidth(end,converPixToDefaultUnit(endWidth - value),getDefaultUnits());
  }
}
Program: 69504
Project: 69504
Buggy source:
protected Dimension getDragWidth(int start,int end){
  return new Dimension(TableUtil.getMinWidth(getCrosstabTableEditPart(),getStart()) - CrosstabTableUtil.caleVisualWidth(getCrosstabTableEditPart(),getStart()),Integer.MAX_VALUE);
}

Fixed version (ground truth):
protected Dimension getDragWidth(int start,int end){
  if (isCtrlDown()) {
    return new Dimension(TableUtil.getMinWidth(getCrosstabTableEditPart(),getStart()) - CrosstabTableUtil.caleVisualWidth(getCrosstabTableEditPart(),getStart()),Integer.MAX_VALUE);
  }
 else {
    if (getStart() == getEnd()) {
      return new Dimension(TableUtil.getMinWidth(getCrosstabTableEditPart(),getStart()) - CrosstabTableUtil.caleVisualWidth(getCrosstabTableEditPart(),getStart()),Integer.MAX_VALUE);
    }
    return new Dimension(TableUtil.getMinWidth(getCrosstabTableEditPart(),getStart()) - CrosstabTableUtil.caleVisualWidth(getCrosstabTableEditPart(),getStart()),CrosstabTableUtil.caleVisualWidth(getCrosstabTableEditPart(),getEnd()) - TableUtil.getMinWidth(getCrosstabTableEditPart(),getEnd()));
  }
}
Program: 69505
Project: 69505
Buggy source:
protected Data addDataContent(IDataContent data){
  HyperlinkDef url=parseHyperLink(data);
  BookmarkDef bookmark=getBookmark(data);
  Data excelData=null;
  Object generateBy=data.getGenerateBy();
  IStyle style=data.getComputedStyle();
  DataFormatValue dataformat=style.getDataFormat();
  MapDesign map=null;
  if (generateBy instanceof DataItemDesign) {
    DataItemDesign design=(DataItemDesign)generateBy;
    map=design.getMap();
  }
  if (map != null && map.getRuleCount() > 0 && data.getLabelText() != null) {
    excelData=engine.addData(data.getLabelText().trim(),style,url,bookmark);
  }
 else {
    String locale=null;
    int type=ExcelUtil.getType(data.getValue());
    if (type == SheetData.STRING) {
      if (dataformat != null) {
        locale=dataformat.getStringLocale();
      }
      excelData=engine.addData(data.getText(),style,url,bookmark,locale);
    }
 else     if (type == Data.NUMBER) {
      if (dataformat != null) {
        locale=dataformat.getStringLocale();
      }
      excelData=engine.addData(data.getValue(),style,url,bookmark,locale);
    }
 else {
      if (dataformat != null) {
        locale=dataformat.getStringLocale();
      }
      excelData=engine.addDateTime(data,style,url,bookmark,locale);
    }
  }
  return excelData;
}

Fixed version (ground truth):
protected Data addDataContent(IDataContent data){
  HyperlinkDef url=parseHyperLink(data);
  BookmarkDef bookmark=getBookmark(data);
  Data excelData=null;
  Object generateBy=data.getGenerateBy();
  IStyle style=data.getComputedStyle();
  DataFormatValue dataformat=style.getDataFormat();
  MapDesign map=null;
  if (generateBy instanceof DataItemDesign) {
    DataItemDesign design=(DataItemDesign)generateBy;
    map=design.getMap();
  }
  if (map != null && map.getRuleCount() > 0 && data.getLabelText() != null) {
    excelData=engine.addData(data.getLabelText().trim(),style,url,bookmark);
  }
 else {
    String locale=null;
    int type=ExcelUtil.getType(data.getValue());
    if (type == SheetData.STRING) {
      if (dataformat != null) {
        locale=dataformat.getStringLocale();
      }
      excelData=engine.addData(data.getText(),style,url,bookmark,locale);
    }
 else     if (type == Data.NUMBER) {
      if (dataformat != null) {
        locale=dataformat.getNumberLocale();
      }
      excelData=engine.addData(data.getValue(),style,url,bookmark,locale);
    }
 else {
      if (dataformat != null) {
        locale=dataformat.getDateTimeLocale();
      }
      excelData=engine.addDateTime(data,style,url,bookmark,locale);
    }
  }
  return excelData;
}
Program: 69506
Project: 69506
Buggy source:
public Object getLevelAttribute(int levelIndex,int attributeIndex){
  return this.rs.getLevelAttribute(levelIndex,attributeIndex);
}

Fixed version (ground truth):
public Object getLevelAttribute(int levelIndex,int attributeIndex){
  if (levelIndex < 0 || resultObject.length < levelIndex) {
    return null;
  }
  return ((Member)this.resultObject[levelIndex]).getAttributes()[attributeIndex];
}
Program: 69507
Project: 69507
Buggy source:
public MirroredAggregationResultSet(IAggregationResultSet rs,int mirrorLevel,boolean breakHierarchy,List sortList) throws IOException {
  this.mirrorLevel=mirrorLevel;
  this.breakHierarchy=breakHierarchy;
  this.rootNode=new MemberTreeNode("String_Node_Str");
  this.resultObject=new Object[rs.getLevelCount()];
  this.rs=rs;
  this.sortList=sortList;
  this.isTimeMirror=TimeMemberUtil.containsTimeMirror(rs,mirrorLevel);
  if (!isTimeMirror && breakHierarchy) {
    this.breakHierarchyList=new ArrayList[rs.getLevelCount() - mirrorLevel];
    for (int j=0; j < breakHierarchyList.length; j++) {
      breakHierarchyList[j]=new ArrayList();
    }
    populateMirror();
  }
 else {
    if (!breakHierarchy) {
      this.mirrorLevel=this.mirrorLevel - 1;
    }
    populateTimeMirror();
    nodeLength=getLength(this.rootNode);
    valueMapLength=0;
    Iterator iter=this.noBreakHierarchyKeyMap.entrySet().iterator();
    while (iter.hasNext()) {
      valueMapLength+=getLength((MemberTreeNode)((Entry)iter.next()).getValue());
    }
    this.length=nodeLength * valueMapLength;
  }
}

Fixed version (ground truth):
public MirroredAggregationResultSet(IAggregationResultSet rs,int mirrorLevel,boolean breakHierarchy,List sortList) throws IOException {
  this.mirrorLevel=mirrorLevel;
  this.breakHierarchy=breakHierarchy;
  Member member=new Member();
  member.setKeyValues(new Object[]{"String_Node_Str"});
  this.rootNode=new MemberTreeNode(member);
  this.resultObject=new Object[rs.getLevelCount()];
  this.rs=rs;
  this.sortList=sortList;
  this.isTimeMirror=TimeMemberUtil.containsTimeMirror(rs,mirrorLevel);
  if (!isTimeMirror && breakHierarchy) {
    this.breakHierarchyList=new ArrayList[rs.getLevelCount() - mirrorLevel];
    for (int j=0; j < breakHierarchyList.length; j++) {
      breakHierarchyList[j]=new ArrayList();
    }
    populateMirror();
  }
 else {
    if (!breakHierarchy) {
      this.mirrorLevel=this.mirrorLevel - 1;
    }
    populateTimeMirror();
    nodeLength=getLength(this.rootNode);
    valueMapLength=0;
    Iterator iter=this.noBreakHierarchyKeyMap.entrySet().iterator();
    while (iter.hasNext()) {
      valueMapLength+=getLength((MemberTreeNode)((Entry)iter.next()).getValue());
    }
    this.length=nodeLength * valueMapLength;
  }
}
Program: 69508
Project: 69508
Buggy source:
public Object[] getLevelKeyValue(int levelIndex){
  return new Object[]{this.resultObject[levelIndex]};
}

Fixed version (ground truth):
public Object[] getLevelKeyValue(int levelIndex){
  return ((Member)this.resultObject[levelIndex]).getKeyValues();
}
Program: 69511
Project: 69511
Buggy source:
public void startRow(IRowContent row){
  if (!isHidden(row)) {
    rowFilledFlag=false;
    boolean isHeader=false;
    styles.push(row.getComputedStyle());
    if (row.getBand() != null && row.getBand().getBandType() == IBandContent.BAND_HEADER) {
      isHeader=true;
    }
    double height=WordUtil.convertTo(row.getHeight());
    wordWriter.startTableRow(height,isHeader,row.getTable().isHeaderRepeat());
    context.newRow();
  }
}

Fixed version (ground truth):
public void startRow(IRowContent row){
  if (!isHidden(row)) {
    rowFilledFlag=false;
    boolean isHeader=false;
    styles.push(row.getComputedStyle());
    if (row.getBand() != null && row.getBand().getBandType() == IBandContent.BAND_HEADER) {
      isHeader=true;
    }
    double height=WordUtil.convertTo(row.getHeight());
    wordWriter.startTableRow(height,isHeader,row.getTable().isHeaderRepeat(),fixedLayout);
    context.newRow();
  }
}
Program: 69512
Project: 69512
Buggy source:
public void start(IReportContent report){
  this.reportContent=report;
}

Fixed version (ground truth):
public void start(IReportContent report){
  this.reportContent=report;
  if (null == layoutPreference) {
    ReportDesignHandle designHandle=report.getDesign().getReportDesign();
    if (designHandle != null) {
      String reportLayoutPreference=designHandle.getLayoutPreference();
      if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_FIXED_LAYOUT.equals(reportLayoutPreference)) {
        layoutPreference=HTMLRenderOption.LAYOUT_PREFERENCE_FIXED;
      }
 else       if (DesignChoiceConstants.REPORT_LAYOUT_PREFERENCE_AUTO_LAYOUT.equals(reportLayoutPreference)) {
        layoutPreference=HTMLRenderOption.LAYOUT_PREFERENCE_AUTO;
      }
    }
    fixedLayout=HTMLRenderOption.LAYOUT_PREFERENCE_FIXED.equals(layoutPreference);
  }
}
Program: 69513
Project: 69513
Buggy source:
public void initialize(IEmitterServices service) throws EngineException {
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
    this.reportRunnable=service.getReportRunnable();
    this.actionHandler=(IHTMLActionHandler)service.getOption(RenderOption.ACTION_HANDLER);
    reportContext=service.getReportContext();
    ULocale locale=null;
    if (reportContext != null) {
      locale=ULocale.forLocale(reportContext.getLocale());
    }
    if (locale == null) {
      locale=ULocale.getDefault();
    }
    EngineResourceHandle resourceHandle=new EngineResourceHandle(locale);
    messageFlashObjectNotSupported=resourceHandle.getMessage(MessageConstants.FLASH_OBJECT_NOT_SUPPORTED_PROMPT);
  }
  context=new EmitterContext();
}

Fixed version (ground truth):
public void initialize(IEmitterServices service) throws EngineException {
  if (service != null) {
    this.out=EmitterUtil.getOuputStream(service,"String_Node_Str" + getOutputFormat());
    this.reportRunnable=service.getReportRunnable();
    this.actionHandler=(IHTMLActionHandler)service.getOption(RenderOption.ACTION_HANDLER);
    reportContext=service.getReportContext();
    ULocale locale=null;
    if (reportContext != null) {
      locale=ULocale.forLocale(reportContext.getLocale());
    }
    if (locale == null) {
      locale=ULocale.getDefault();
    }
    EngineResourceHandle resourceHandle=new EngineResourceHandle(locale);
    messageFlashObjectNotSupported=resourceHandle.getMessage(MessageConstants.FLASH_OBJECT_NOT_SUPPORTED_PROMPT);
    IRenderOption renderOption=service.getRenderOption();
    if (renderOption != null) {
      HTMLRenderOption htmlOption=new HTMLRenderOption(renderOption);
      layoutPreference=htmlOption.getLayoutPreference();
    }
  }
  context=new EmitterContext();
}
Program: 69514
Project: 69514
Buggy source:
/** 
 * @param style style of the row
 * @param height height of current row, if heigh equals 1 then ignore height
 * @param type header or normal
 */
public void startTableRow(double height,boolean isHeader,boolean repeatHeader){
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  if (height != -1) {
    writeAttrTag("String_Node_Str",height);
  }
  if (isHeader) {
    String headerOnOff=repeatHeader ? "String_Node_Str" : "String_Node_Str";
    writeAttrTag("String_Node_Str",headerOnOff);
  }
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param style style of the row
 * @param height height of current row, if heigh equals 1 then ignore height
 * @param type header or normal
 */
public void startTableRow(double height,boolean isHeader,boolean repeatHeader,boolean fixedLayout){
  writer.openTag("String_Node_Str");
  writer.openTag("String_Node_Str");
  if (height != -1) {
    writer.openTag("String_Node_Str");
    if (fixedLayout) {
      writer.attribute("String_Node_Str","String_Node_Str");
    }
    writer.attribute("String_Node_Str",height);
    writer.closeTag("String_Node_Str");
  }
  if (isHeader) {
    String headerOnOff=repeatHeader ? "String_Node_Str" : "String_Node_Str";
    writeAttrTag("String_Node_Str",headerOnOff);
  }
  writer.closeTag("String_Node_Str");
}
Program: 69515
Project: 69515
Buggy source:
public void startTableRow(double height){
  startTableRow(height,false,false);
}

Fixed version (ground truth):
public void startTableRow(double height){
  startTableRow(height,false,false,false);
}
Program: 69516
Project: 69516
Buggy source:
public IRenderOption getPreferredRenderOption(){
  EXCELRenderOption renderOption=new EXCELRenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  for (  IOptionValue optionValue : values) {
    if (optionValue != null) {
      renderOption.setOption(optionValue.getName(),optionValue.getValue());
    }
  }
  return renderOption;
}

Fixed version (ground truth):
public IRenderOption getPreferredRenderOption(){
  EXCELRenderOption renderOption=new EXCELRenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  for (  IOptionValue optionValue : values) {
    if (optionValue != null) {
      renderOption.setOption(getRenderOptionName(optionValue.getName()),optionValue.getValue());
    }
  }
  return renderOption;
}
Program: 69517
Project: 69517
Buggy source:
private void initOptions(){
  ConfigurableOption wrappingText=new ConfigurableOption(IExcelRenderOption.WRAPPING_TEXT);
  wrappingText.setDisplayName(Messages.getString("String_Node_Str"));
  wrappingText.setDataType(IConfigurableOption.DataType.BOOLEAN);
  wrappingText.setDisplayType(IConfigurableOption.DisplayType.CHECKBOX);
  wrappingText.setDefaultValue(Boolean.TRUE);
  wrappingText.setToolTip(null);
  wrappingText.setDescription(Messages.getString("String_Node_Str"));
  options=new IConfigurableOption[]{wrappingText};
}

Fixed version (ground truth):
private void initOptions(){
  ConfigurableOption wrappingText=new ConfigurableOption(TEXT_WRAPPING);
  wrappingText.setDisplayName(Messages.getString("String_Node_Str"));
  wrappingText.setDataType(IConfigurableOption.DataType.BOOLEAN);
  wrappingText.setDisplayType(IConfigurableOption.DisplayType.CHECKBOX);
  wrappingText.setDefaultValue(Boolean.TRUE);
  wrappingText.setToolTip(null);
  wrappingText.setDescription(Messages.getString("String_Node_Str"));
  options=new IConfigurableOption[]{wrappingText};
}
Program: 69518
Project: 69518
Buggy source:
public IRenderOption getPreferredRenderOption(){
  PDFRenderOption renderOption=new PDFRenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  for (  IOptionValue optionValue : values) {
    if (optionValue != null) {
      renderOption.setOption(optionValue.getName(),optionValue.getValue());
    }
  }
  return renderOption;
}

Fixed version (ground truth):
public IRenderOption getPreferredRenderOption(){
  PDFRenderOption renderOption=new PDFRenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  for (  IOptionValue optionValue : values) {
    if (optionValue != null) {
      renderOption.setOption(getRenderOptionName(optionValue.getName()),optionValue.getValue());
    }
  }
  return renderOption;
}
Program: 69520
Project: 69520
Buggy source:
@Override public IRenderOption getPreferredRenderOption(){
  RenderOption renderOption=new RenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  for (  IOptionValue optionValue : values) {
    if (optionValue != null) {
      renderOption.setOption(optionValue.getName(),optionValue.getValue());
    }
  }
  return renderOption;
}

Fixed version (ground truth):
@Override public IRenderOption getPreferredRenderOption(){
  RenderOption renderOption=new RenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  for (  IOptionValue optionValue : values) {
    if (optionValue != null) {
      renderOption.setOption(getRenderOptionName(optionValue.getName()),optionValue.getValue());
    }
  }
  return renderOption;
}
Program: 69522
Project: 69522
Buggy source:
@Override public IRenderOption getPreferredRenderOption(){
  PDFRenderOption renderOption=new PDFRenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  for (  IOptionValue optionValue : values) {
    if (optionValue != null) {
      renderOption.setOption(optionValue.getName(),optionValue.getValue());
    }
  }
  return renderOption;
}

Fixed version (ground truth):
@Override public IRenderOption getPreferredRenderOption(){
  PDFRenderOption renderOption=new PDFRenderOption();
  renderOption.setEmitterID(getID());
  renderOption.setOutputFormat("String_Node_Str");
  for (  IOptionValue optionValue : values) {
    if (optionValue != null) {
      renderOption.setOption(getRenderOptionName(optionValue.getName()),optionValue.getValue());
    }
  }
  return renderOption;
}
Program: 69524
Project: 69524
Buggy source:
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=LayoutUtil.createTable(table,width);
  if (info == null) {
    return;
  }
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption);
  }
  engine.addTable(table,info,sizeInfo);
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  ContainerSizeInfo sizeInfo=engine.getCurrentContainer().getSizeInfo();
  int width=sizeInfo.getWidth();
  int[] columns=LayoutUtil.createTable(table,LayoutUtil.getElementWidth(table,width));
  ColumnsInfo info=new ColumnsInfo(columns);
  String caption=table.getCaption();
  if (caption != null) {
    engine.addCaption(caption);
  }
  engine.addTable(table,info,sizeInfo);
}
Program: 69525
Project: 69525
Buggy source:
public static ColumnsInfo createTable(ITableContent table,int width){
  int tableWidth=getElementWidth(table,width);
  int columnCount=table.getColumnCount();
  if (columnCount == 0) {
    return null;
  }
  int[] columns=new int[columnCount];
  int unassignedCount=0;
  int totalAssigned=0;
  for (int i=0; i < columnCount; i++) {
    DimensionType value=table.getColumn(i).getWidth();
    if (value == null) {
      columns[i]=-1;
      unassignedCount++;
    }
 else {
      columns[i]=ExcelUtil.covertDimensionType(value,tableWidth);
      totalAssigned+=columns[i];
    }
  }
  int leftWidth=tableWidth - totalAssigned;
  if (leftWidth != 0 && unassignedCount == 0) {
    for (int i=0; i < columnCount; i++) {
      columns[i]=resize(columns[i],totalAssigned,leftWidth);
    }
  }
 else   if (leftWidth < 0 && unassignedCount > 0) {
    for (int i=0; i < columnCount; i++) {
      if (columns[i] == -1)       columns[1]=0;
 else       columns[i]=resize(columns[i],totalAssigned,leftWidth);
    }
  }
 else   if (leftWidth >= 0 && unassignedCount > 0) {
    int per=(int)leftWidth / unassignedCount;
    int index=0;
    for (int i=0; i < columns.length; i++) {
      if (columns[i] == -1) {
        columns[i]=per;
        index=i;
      }
    }
    columns[index]=leftWidth - per * (unassignedCount - 1);
  }
  return new ColumnsInfo(columns);
}

Fixed version (ground truth):
public static int[] createTable(ITableContent table,int tableWidth){
  int columnCount=table.getColumnCount();
  int[] columns=new int[columnCount];
  int unassignedCount=0;
  int totalAssigned=0;
  for (int i=0; i < columnCount; i++) {
    DimensionType value=table.getColumn(i).getWidth();
    if (value == null) {
      columns[i]=-1;
      unassignedCount++;
    }
 else {
      columns[i]=ExcelUtil.covertDimensionType(value,tableWidth);
      totalAssigned+=columns[i];
    }
  }
  if (table.getWidth() == null && unassignedCount == 0) {
    return columns;
  }
  return EmitterUtil.resizeTableColumn(tableWidth,columns,unassignedCount,totalAssigned);
}
Program: 69526
Project: 69526
Buggy source:
private static int getElementWidth(IContent content,int width){
  DimensionType value=content.getWidth();
  if (value != null) {
    try {
      width=Math.min(ExcelUtil.covertDimensionType(value,width),width);
    }
 catch (    Exception e) {
    }
  }
  return width;
}

Fixed version (ground truth):
public static int getElementWidth(IContent content,int width){
  DimensionType value=content.getWidth();
  if (value != null) {
    try {
      width=Math.min(ExcelUtil.covertDimensionType(value,width),width);
    }
 catch (    Exception e) {
    }
  }
  return width;
}
Program: 69527
Project: 69527
Buggy source:
public void startTable(ITableContent table){
  adjustInline();
  styles.push(table.getComputedStyle());
  writeBookmark(table);
  Object tableToc=table.getTOC();
  if (tableToc != null) {
    tableTocs.add(new TocInfo(tableToc.toString(),tocLevel));
  }
  increaseTOCLevel(table);
  String caption=table.getCaption();
  if (caption != null) {
    wordWriter.writeCaption(caption);
  }
  if (context.isLastTable()) {
    wordWriter.insertHiddenParagraph();
  }
  int width=WordUtil.convertTo(table.getWidth(),context.getCurrentWidth());
  width=Math.min(width,context.getCurrentWidth());
  wordWriter.startTable(table.getComputedStyle(),width);
  int[] cols=computeTblColumnWidths(table,width);
  wordWriter.writeColumn(cols);
  context.addTable(cols,table.getComputedStyle());
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  adjustInline();
  styles.push(table.getComputedStyle());
  writeBookmark(table);
  Object tableToc=table.getTOC();
  if (tableToc != null) {
    tableTocs.add(new TocInfo(tableToc.toString(),tocLevel));
  }
  increaseTOCLevel(table);
  String caption=table.getCaption();
  if (caption != null) {
    wordWriter.writeCaption(caption);
  }
  if (context.isLastTable()) {
    wordWriter.insertHiddenParagraph();
  }
  int width=WordUtil.convertTo(table.getWidth(),context.getCurrentWidth());
  width=Math.min(width,context.getCurrentWidth());
  int[] cols=computeTblColumnWidths(table,width);
  wordWriter.startTable(table.getComputedStyle(),getTableWidth(cols));
  wordWriter.writeColumn(cols);
  context.addTable(cols,table.getComputedStyle());
}
Program: 69528
Project: 69528
Buggy source:
private int[] computeTblColumnWidths(ITableContent table,int tblWidth){
  int colCount=table.getColumnCount();
  int[] tblColumns=new int[colCount];
  int count=0;
  int total=0;
  for (int i=0; i < colCount; i++) {
    IColumn col=table.getColumn(i);
    if (col.getWidth() == null) {
      tblColumns[i]=-1;
      count++;
    }
 else {
      tblColumns[i]=WordUtil.convertTo(col.getWidth(),tblWidth);
      total+=tblColumns[i];
    }
  }
  for (int i=0; i < tblColumns.length; i++) {
    if (tblColumns[i] == -1) {
      tblColumns[i]=(tblWidth - total) / count;
    }
  }
  return tblColumns;
}

Fixed version (ground truth):
private int[] computeTblColumnWidths(ITableContent table,int tblWidth){
  int colCount=table.getColumnCount();
  int[] tblColumns=new int[colCount];
  int count=0;
  int total=0;
  for (int i=0; i < colCount; i++) {
    IColumn col=table.getColumn(i);
    if (col.getWidth() == null) {
      tblColumns[i]=-1;
      count++;
    }
 else {
      tblColumns[i]=WordUtil.convertTo(col.getWidth(),tblWidth);
      total+=tblColumns[i];
    }
  }
  if (table.getWidth() == null && count == 0) {
    return tblColumns;
  }
  return EmitterUtil.resizeTableColumn(tblWidth,tblColumns,count,total);
}
Program: 69529
Project: 69529
Buggy source:
protected void buildLogicContainerProperties(IContent content,LayoutContext context){
  IStyle style=content.getStyle();
  if (style != null && !style.isEmpty()) {
    boxStyle=new BoxStyle();
    IStyle cs=content.getComputedStyle();
    Color color=PropertyUtil.getColor(cs.getProperty(IStyle.STYLE_BACKGROUND_COLOR));
    if (color != null) {
      boxStyle.setBackgroundColor(color);
    }
    String url=style.getBackgroundImage();
    if (url != null) {
      boxStyle.setBackgroundImage(new BackgroundImageInfo(getImageUrl(url),cs.getProperty(IStyle.STYLE_BACKGROUND_REPEAT),0,0,0,0));
    }
    if (!isInInlineStacking) {
      pageBreakAfter=cs.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
      pageBreakInside=cs.getProperty(IStyle.STYLE_PAGE_BREAK_INSIDE);
      pageBreakBefore=cs.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    }
  }
 else {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
  }
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
}

Fixed version (ground truth):
protected void buildLogicContainerProperties(IContent content,LayoutContext context){
  IStyle style=content.getStyle();
  if (style != null && !style.isEmpty()) {
    boxStyle=new BoxStyle();
    IStyle cs=content.getComputedStyle();
    Color color=PropertyUtil.getColor(cs.getProperty(IStyle.STYLE_BACKGROUND_COLOR));
    if (color != null) {
      boxStyle.setBackgroundColor(color);
    }
    String url=style.getBackgroundImage();
    if (url != null) {
      boxStyle.setBackgroundImage(new BackgroundImageInfo(getImageUrl(url),cs.getProperty(IStyle.STYLE_BACKGROUND_REPEAT),0,0,0,0));
    }
    if (!isInInlineStacking) {
      pageBreakAfter=cs.getProperty(IStyle.STYLE_PAGE_BREAK_AFTER);
      if (pageBreakInside == null) {
        pageBreakInside=cs.getProperty(IStyle.STYLE_PAGE_BREAK_INSIDE);
      }
      pageBreakBefore=cs.getProperty(IStyle.STYLE_PAGE_BREAK_BEFORE);
    }
  }
 else {
    hasStyle=false;
    boxStyle=BoxStyle.DEFAULT;
    localProperties=LocalProperties.DEFAULT;
  }
  bookmark=content.getBookmark();
  action=content.getHyperlinkAction();
}
Program: 69531
Project: 69531
Buggy source:
protected void updateBackgroundImage(){
  BackgroundImageInfo bgi=boxStyle.getBackgroundImage();
  Image img=null;
  if (bgi != null) {
    if ((bgi.getXOffset() != 0 || bgi.getYOffset() != 0)) {
      String imageUrl=bgi.getUrl();
      try {
        img=Image.getInstance(new URL(bgi.getUrl()));
      }
 catch (      Exception e) {
        if (SvgFile.isSvg(imageUrl)) {
          try {
            img=Image.getInstance(SvgFile.transSvgToArray(imageUrl));
          }
 catch (          Exception ex) {
            logger.log(Level.WARNING,ex.getMessage(),ex);
          }
        }
 else {
          logger.log(Level.WARNING,e.getMessage(),e);
        }
      }
      if (img != null) {
        int resolutionX=img.getDpiX();
        int resolutionY=img.getDpiY();
        if (0 == resolutionX || 0 == resolutionY) {
          resolutionX=96;
          resolutionY=96;
        }
        float imageWidth=img.plainWidth() / resolutionX * 72;
        float imageHeight=img.plainHeight() / resolutionY * 72;
        if (content != null) {
          IStyle style=content.getComputedStyle();
          int ox=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),(width - (int)(imageWidth * PDFConstants.LAYOUT_TO_PDF_RATIO)));
          int oy=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),(height - (int)(imageHeight * PDFConstants.LAYOUT_TO_PDF_RATIO)));
          bgi.setXOffset(ox);
          bgi.setYOffset(oy);
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void updateBackgroundImage(){
  BackgroundImageInfo bgi=boxStyle.getBackgroundImage();
  Image img=null;
  if (bgi != null) {
    String imageUrl=bgi.getUrl();
    try {
      img=Image.getInstance(new URL(bgi.getUrl()));
    }
 catch (    Exception e) {
      if (SvgFile.isSvg(imageUrl)) {
        try {
          img=Image.getInstance(SvgFile.transSvgToArray(imageUrl));
        }
 catch (        Exception ex) {
          logger.log(Level.WARNING,ex.getMessage(),ex);
        }
      }
 else {
        logger.log(Level.WARNING,e.getMessage(),e);
      }
    }
    if (img != null) {
      int resolutionX=img.getDpiX();
      int resolutionY=img.getDpiY();
      if (0 == resolutionX || 0 == resolutionY) {
        resolutionX=96;
        resolutionY=96;
      }
      float imageWidth=img.plainWidth() / resolutionX * 72;
      float imageHeight=img.plainHeight() / resolutionY * 72;
      if (content != null) {
        IStyle style=content.getComputedStyle();
        int ox=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_X),(width - (int)(imageWidth * PDFConstants.LAYOUT_TO_PDF_RATIO)));
        int oy=getDimensionValue(style.getProperty(IStyle.STYLE_BACKGROUND_POSITION_Y),(height - (int)(imageHeight * PDFConstants.LAYOUT_TO_PDF_RATIO)));
        bgi.setXOffset(ox);
        bgi.setYOffset(oy);
      }
    }
  }
}
Program: 69532
Project: 69532
Buggy source:
/** 
 * @param name
 * @param resultSets
 * @param writer
 * @throws IOException
 */
public static void save(String name,IAggregationResultSet[] resultSets,IDocArchiveWriter writer) throws IOException {
  if (name == null)   return;
  RAOutputStream outputStream=writer.createRandomAccessStream(name);
  DataOutputStream dataOutputStream=new DataOutputStream(outputStream);
  if (resultSets == null) {
    dataOutputStream.writeInt(-1);
    return;
  }
  dataOutputStream.writeInt(resultSets.length);
  dataOutputStream.close();
  for (int i=0; i < resultSets.length; i++) {
    outputStream=writer.createRandomAccessStream(name + PREFIX_RESULTSET + i);
    dataOutputStream=new DataOutputStream(outputStream);
    saveOneResultSet(dataOutputStream,resultSets[i]);
    dataOutputStream.close();
  }
}

Fixed version (ground truth):
/** 
 * @param name
 * @param resultSets
 * @param writer
 * @throws IOException
 */
public static void save(String name,IAggregationResultSet[] resultSets,IDocArchiveWriter writer) throws IOException {
  if (writer == null || name == null)   return;
  RAOutputStream outputStream=writer.createRandomAccessStream(name);
  DataOutputStream dataOutputStream=new DataOutputStream(outputStream);
  if (resultSets == null) {
    dataOutputStream.writeInt(-1);
    return;
  }
  dataOutputStream.writeInt(resultSets.length);
  dataOutputStream.close();
  for (int i=0; i < resultSets.length; i++) {
    outputStream=writer.createRandomAccessStream(name + PREFIX_RESULTSET + i);
    dataOutputStream=new DataOutputStream(outputStream);
    saveOneResultSet(dataOutputStream,resultSets[i]);
    dataOutputStream.close();
  }
}
Program: 69534
Project: 69534
Buggy source:
public void execute(final IProgressMonitor monitor) throws CoreException, IOException {
  if (file.exists() || file.createNewFile()) {
    FileOutputStream out=new FileOutputStream(file);
    try {
      moduleHandle.serialize(out);
    }
  finally {
      out.close();
    }
    if (oldReportPath != null) {
      copyReportConfigFile(new Path(file.getAbsolutePath()),oldReportPath);
    }
  }
}

Fixed version (ground truth):
public void execute(final IProgressMonitor monitor) throws CoreException, IOException {
  if (file.exists() || file.createNewFile()) {
    OutputStream out=new BufferedOutputStream(new FileOutputStream(file),8192 * 2);
    try {
      moduleHandle.serialize(out);
      out.flush();
    }
  finally {
      out.close();
    }
    if (oldReportPath != null) {
      copyReportConfigFile(new Path(file.getAbsolutePath()),oldReportPath);
    }
  }
}
Program: 69535
Project: 69535
Buggy source:
/** 
 * The method checks if specified aggregate function is a magic aggregate, it means these aggregates operations will change data type. <p> Now the magic aggregates in chart include Count, DistinctCount, Top, TopPercent, Bottom, BottomPercent, Rank and PercentRank.
 * @param aggFunc
 * @return if magic aggregate
 * @since BIRT 2.3
 */
public static boolean isMagicAggregate(String aggFunc){
  return PluginSettings.DefaultAggregations.COUNT.equals(aggFunc) || PluginSettings.DefaultAggregations.DISTINCT_COUNT.equals(aggFunc) || PluginSettings.DefaultAggregations.TOP.equals(aggFunc)|| PluginSettings.DefaultAggregations.TOP_PERCENT.equals(aggFunc)|| PluginSettings.DefaultAggregations.BOTTOM.equals(aggFunc)|| PluginSettings.DefaultAggregations.BOTTOM_PERCENT.equals(aggFunc)|| PluginSettings.DefaultAggregations.RANK.equals(aggFunc)|| PluginSettings.DefaultAggregations.PERCENT_RANK.equals(aggFunc);
}

Fixed version (ground truth):
/** 
 * The method checks if specified aggregate function is a magic aggregate, it means these aggregates operations will change data type. <p> Now the magic aggregates in chart include Count, DistinctCount, Top, TopPercent, Bottom, BottomPercent, Rank, PercentRank and Running Count.
 * @param aggFunc
 * @return if magic aggregate
 * @since BIRT 2.3
 */
public static boolean isMagicAggregate(String aggFunc){
  return PluginSettings.DefaultAggregations.COUNT.equals(aggFunc) || PluginSettings.DefaultAggregations.DISTINCT_COUNT.equals(aggFunc) || PluginSettings.DefaultAggregations.TOP.equals(aggFunc)|| PluginSettings.DefaultAggregations.TOP_PERCENT.equals(aggFunc)|| PluginSettings.DefaultAggregations.BOTTOM.equals(aggFunc)|| PluginSettings.DefaultAggregations.BOTTOM_PERCENT.equals(aggFunc)|| PluginSettings.DefaultAggregations.RANK.equals(aggFunc)|| PluginSettings.DefaultAggregations.PERCENT_RANK.equals(aggFunc)|| PluginSettings.DefaultAggregations.RUNNING_COUNT.equals(aggFunc);
}
Program: 69537
Project: 69537
Buggy source:
/** 
 * Set state of SortKey components.
 * @param enabled
 * @since BIRT 2.3
 */
protected void setSortKeySelectionState(boolean enabled){
  cmbSortExpr.setEnabled(enabled);
  if (btnSortExprBuilder != null) {
    btnSortExprBuilder.setEnabled(enabled);
  }
}

Fixed version (ground truth):
/** 
 * Set state of SortKey components.
 * @param enabled
 * @since BIRT 2.3
 */
protected void setSortKeySelectionState(boolean enabled){
  lblSortExpr.setEnabled(enabled);
  cmbSortExpr.setEnabled(enabled);
  if (btnSortExprBuilder != null) {
    btnSortExprBuilder.setEnabled(enabled);
  }
}
Program: 69538
Project: 69538
Buggy source:
public void createSortArea(Composite parent){
  super.createSortArea(parent);
  if (!isYGroupingEnabled()) {
    cmbSorting.setEnabled(false);
    cmbSortExpr.setEnabled(false);
  }
}

Fixed version (ground truth):
public void createSortArea(Composite parent){
  super.createSortArea(parent);
  if (!isYGroupingEnabled()) {
    lblSorting.setEnabled(false);
    cmbSorting.setEnabled(false);
    lblSortExpr.setEnabled(false);
    cmbSortExpr.setEnabled(false);
  }
}
Program: 69539
Project: 69539
Buggy source:
/** 
 * Checks if grouping is supported.
 * @param wizardContext
 * @since 2.3
 */
public static boolean isGroupingSupported(ChartWizardContext wizardContext){
  final int state=wizardContext.getDataServiceProvider().getState();
  return (state & IDataServiceProvider.SHARE_QUERY) != IDataServiceProvider.SHARE_QUERY && (state & IDataServiceProvider.INHERIT_COLUMNS_GROUPS) != IDataServiceProvider.INHERIT_COLUMNS_GROUPS;
}

Fixed version (ground truth):
/** 
 * Checks if grouping is supported.
 * @param wizardContext
 * @since 2.3
 */
public static boolean isGroupingSupported(ChartWizardContext wizardContext){
  final int state=wizardContext.getDataServiceProvider().getState();
  return (state & IDataServiceProvider.SHARE_QUERY) != IDataServiceProvider.SHARE_QUERY && (state & IDataServiceProvider.INHERIT_COLUMNS_GROUPS) != IDataServiceProvider.INHERIT_COLUMNS_GROUPS && (state & IDataServiceProvider.HAS_CUBE) != IDataServiceProvider.HAS_CUBE;
}
Program: 69541
Project: 69541
Buggy source:
/** 
 * @param dataSet
 * @throws BirtException
 */
private void doDefineDataSet(DataSetHandle dataSet) throws BirtException {
  if (dataSet instanceof JointDataSetHandle) {
    JointDataSetHandle jointDataSet=(JointDataSetHandle)dataSet;
    Iterator iter=((JointDataSetHandle)jointDataSet).dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle childDataSet=(DataSetHandle)iter.next();
      if (childDataSet != null) {
        DataSourceHandle childDataSource=childDataSet.getDataSource();
        if (childDataSource != null) {
          doDefineDataSource(childDataSource);
        }
        doDefineDataSet(childDataSet);
      }
    }
  }
  dteSession.defineDataSet(dteSession.getModelAdaptor().adaptDataSet(dataSet));
}

Fixed version (ground truth):
/** 
 * @param dataSet
 * @throws BirtException
 */
private void doDefineDataSet(DataSetHandle dataSet) throws BirtException {
  if (dataSet instanceof JointDataSetHandle) {
    JointDataSetHandle jointDataSet=(JointDataSetHandle)dataSet;
    Iterator iter=((JointDataSetHandle)jointDataSet).dataSetsIterator();
    while (iter.hasNext()) {
      DataSetHandle childDataSet=(DataSetHandle)iter.next();
      if (childDataSet != null) {
        DataSourceHandle childDataSource=childDataSet.getDataSource();
        if (childDataSource != null) {
          doDefineDataSource(childDataSource);
        }
        doDefineDataSet(childDataSet);
      }
    }
  }
  dteSession.defineDataSet(this.appendRuntimeInfoToDataSet(dataSet,dteSession.getModelAdaptor().adaptDataSet(dataSet)));
}
Program: 69542
Project: 69542
Buggy source:
/** 
 * Create an IJointDataSetDesign instance.
 * @param handle
 * @param context2
 * @return
 * @throws BirtException
 */
private IJointDataSetDesign newJointDataSet(JointDataSetHandle handle) throws BirtException {
  IBaseDataSetEventHandler eventHandler=new DataSetScriptExecutor(handle,context);
  JointDataSetDesign dteDataSet=(JointDataSetDesign)this.dteSession.getModelAdaptor().adaptDataSet(handle);
  dteDataSet.setEventHandler(eventHandler);
  return dteDataSet;
}

Fixed version (ground truth):
/** 
 * Create an IJointDataSetDesign instance.
 * @param handle
 * @param context2
 * @return
 * @throws BirtException
 */
private IJointDataSetDesign newJointDataSet(JointDataSetHandle handle,JointDataSetDesign dteDataSet) throws BirtException {
  IBaseDataSetEventHandler eventHandler=new DataSetScriptExecutor(handle,context);
  dteDataSet.setEventHandler(eventHandler);
  return dteDataSet;
}
Program: 69543
Project: 69543
Buggy source:
IScriptDataSetDesign newScriptDataSet(ScriptDataSetHandle modelDataSet,ExecutionContext context) throws BirtException {
  ScriptDataSetDesign dteDataSet=new ScriptDataSetDesign(modelDataSet.getQualifiedName());
  IScriptDataSetEventHandler eventHandler=new ScriptDataSetScriptExecutor(modelDataSet,context);
  dteDataSet.setEventHandler(eventHandler);
  adaptBaseDataSet(modelDataSet,dteDataSet);
  dteDataSet.setOpenScript(modelDataSet.getOpen());
  dteDataSet.setFetchScript(modelDataSet.getFetch());
  dteDataSet.setCloseScript(modelDataSet.getClose());
  dteDataSet.setDescribeScript(modelDataSet.getDescribe());
  return dteDataSet;
}

Fixed version (ground truth):
IScriptDataSetDesign newScriptDataSet(ScriptDataSetHandle modelDataSet,ScriptDataSetDesign dteDataSet,ExecutionContext context) throws BirtException {
  IScriptDataSetEventHandler eventHandler=new ScriptDataSetScriptExecutor(modelDataSet,context);
  dteDataSet.setEventHandler(eventHandler);
  return dteDataSet;
}