nus-yam/ex-repair huggingface dataset:
Program: 66770
Project: 66770
Buggy source:
private UnresolvedRowHint convertRowToHint(RowArea row){
  IRowContent rowContent=(IRowContent)row.getContent();
  ITableContent table=rowContent.getTable();
  InstanceID tableId=table.getInstanceID();
  InstanceID rowId=rowContent.getInstanceID();
  UnresolvedRowHint hint=new UnresolvedRowHint(tableId.toUniqueString(),rowId.toUniqueString());
  if (row.cells != null) {
    for (int i=0; i < row.cells.length; i++) {
      AbstractArea area=(AbstractArea)row.cells[i];
      String style=null;
      if (area instanceof DummyCell) {
        CellArea cell=((DummyCell)area).getCell();
        ICellContent cellContent=(ICellContent)cell.getContent();
        if (cellContent != null) {
          style=cellContent.getStyle().getCssText();
        }
        hint.addUnresolvedCell(style,cell.columnID,((DummyCell)area).colSpan,((DummyCell)area).rowSpan);
      }
 else       if (area instanceof CellArea) {
        CellArea cell=(CellArea)area;
        ICellContent cellContent=(ICellContent)cell.getContent();
        if (cellContent != null) {
          style=cellContent.getStyle().getCssText();
        }
        hint.addUnresolvedCell(style,cell.columnID,cell.colSpan,cell.rowSpan);
      }
    }
  }
  return hint;
}

Fixed version (ground truth):
private UnresolvedRowHint convertRowToHint(RowArea row){
  IRowContent rowContent=(IRowContent)row.getContent();
  ITableContent table=rowContent.getTable();
  InstanceID tableId=table.getInstanceID();
  InstanceID rowId=rowContent.getInstanceID();
  UnresolvedRowHint hint=new UnresolvedRowHint(tableId.toUniqueString(),rowId.toUniqueString());
  if (row.cells != null) {
    for (int i=0; i < row.cells.length; i++) {
      AbstractArea area=(AbstractArea)row.cells[i];
      String style=null;
      if (area instanceof DummyCell) {
        CellArea cell=((DummyCell)area).getCell();
        ICellContent cellContent=(ICellContent)cell.getContent();
        if (cellContent != null) {
          style=cellContent.getStyle().getCssText();
        }
        hint.addUnresolvedCell(style,cell.columnID,((DummyCell)area).colSpan,((DummyCell)area).rowSpan);
      }
 else       if (area instanceof CellArea) {
        CellArea cell=(CellArea)area;
        ICellContent cellContent=(ICellContent)cell.getContent();
        if (cellContent != null) {
          style=cellContent.getStyle().getCssText();
        }
        hint.addUnresolvedCell(style,cellContent.getColumn(),cellContent.getColSpan(),cellContent.getRowSpan());
      }
    }
  }
  return hint;
}
Program: 66771
Project: 66771
Buggy source:
public Object[] getElements(Object inputElement){
  ArrayList elementsList=new ArrayList(inputParameterGroup.getParameters().getContents());
  for (Iterator iter=elementsList.iterator(); iter.hasNext(); ) {
    ScalarParameterHandle handle=(ScalarParameterHandle)iter.next();
    String[] columns=getDataSetColumns(handle,false);
    boolean found=false;
    for (int i=0; i < columns.length; i++) {
      if (DEUtil.getColumnExpression(columns[i]).equals(handle.getValueExpr())) {
        found=true;
        break;
      }
    }
    if (!found) {
      try {
        handle.setValueExpr(null);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
  return elementsList.toArray();
}

Fixed version (ground truth):
public Object[] getElements(Object inputElement){
  ArrayList elementsList=new ArrayList(inputParameterGroup.getParameters().getContents());
  for (Iterator iter=elementsList.iterator(); iter.hasNext(); ) {
    ScalarParameterHandle handle=(ScalarParameterHandle)iter.next();
    String[] columns=getDataSetColumns(handle,false);
    boolean found=false;
    for (int i=0; i < columns.length; i++) {
      if (DEUtil.getColumnExpression(columns[i]).equals(handle.getValueExpr()) || DEUtil.getResultSetColumnExpression(columns[i]).equals(handle.getValueExpr())) {
        found=true;
        break;
      }
    }
    if (!found) {
      try {
        handle.setValueExpr(null);
      }
 catch (      SemanticException e) {
        ExceptionHandler.handle(e);
      }
    }
  }
  return elementsList.toArray();
}
Program: 66773
Project: 66773
Buggy source:
public void testNullKeyValue() throws IOException {
  RAMBTreeFile file=new RAMBTreeFile();
  BTreeOption<Integer,String> option=new BTreeOption<Integer,String>();
  option.setHasValue(true);
  option.setKeySize(4);
  option.setKeySerializer(new IntegerSerializer());
  option.setFile(file);
  option.setAllowNullKey(true);
  BTree<Integer,String> btree=new BTree<Integer,String>(option);
  for (int i=0; i < 10000; i++) {
    if (!btree.exist(Integer.valueOf(i))) {
      btree.insert(Integer.valueOf(i),(String)null);
    }
  }
  btree.insert(null,"String_Node_Str");
  assertEquals(10001,btree.getTotalKeys());
  assertEquals(10001,btree.getTotalValues());
  btree.close();
}

Fixed version (ground truth):
public void testNullKeyValue() throws IOException {
  RAMBTreeFile file=new RAMBTreeFile();
  BTreeOption<Integer,String> option=new BTreeOption<Integer,String>();
  option.setHasValue(true);
  option.setKeySerializer(new IntegerSerializer());
  option.setFile(file);
  option.setAllowNullKey(true);
  BTree<Integer,String> btree=new BTree<Integer,String>(option);
  for (int i=0; i < 10000; i++) {
    if (!btree.exist(Integer.valueOf(i))) {
      btree.insert(Integer.valueOf(i),(String)null);
    }
  }
  btree.insert(null,"String_Node_Str");
  assertEquals(10001,btree.getTotalKeys());
  assertEquals(10001,btree.getTotalValues());
  btree.close();
}
Program: 66774
Project: 66774
Buggy source:
int getKeySize(BTreeValue<K> key){
  if (keySize == 0) {
    return 4 + key.getBytes().length;
  }
  return keySize;
}

Fixed version (ground truth):
int getKeySize(BTreeValue<K> key){
  if (allowNullKey) {
    if (key == NULL_KEY) {
      return 1;
    }
    if (keySize == 0) {
      return 5 + key.getBytes().length;
    }
    return keySize + 1;
  }
  if (keySize == 0) {
    return 4 + key.getBytes().length;
  }
  return keySize;
}
Program: 66775
Project: 66775
Buggy source:
private void setAxisDeleteEnabled(){
  if (btnAxisDelete != null) {
    btnAxisDelete.setEnabled(ChartUIUtil.getOrthogonalAxisNumber(getChart()) > 1);
  }
}

Fixed version (ground truth):
private void setAxisDeleteEnabled(){
  if (btnAxisDelete != null) {
    btnAxisDelete.setEnabled(ChartUIUtil.getOrthogonalAxisNumber(getChart()) > 1 && cmbAxisSelect.getSelectionIndex() > 0);
  }
}
Program: 66777
Project: 66777
Buggy source:
private void setSeriesDeleteEnabled(){
  if (btnSeriesDelete != null) {
    btnSeriesDelete.setEnabled(seriesDefns.size() > 1);
  }
}

Fixed version (ground truth):
private void setSeriesDeleteEnabled(){
  if (btnSeriesDelete != null) {
    btnSeriesDelete.setEnabled(seriesDefns.size() > 1 && cmbSeriesSelect.getSelectionIndex() > 0);
  }
}
Program: 66779
Project: 66779
Buggy source:
ControlPanel(SwingChartViewerSelector scv){
  this.scv=scv;
  setLayout(new GridLayout(0,1,0,0));
  JPanel jp1=new JPanel();
  jp1.setLayout(new FlowLayout(FlowLayout.LEFT,5,5));
  jp1.add(new JLabel("String_Node_Str"));
  jcbModels=new JComboBox();
  String[] models=PrimitiveCharts.getAvailableModelList();
  for (int i=0; i < models.length; i++) {
    jcbModels.addItem(models[i]);
  }
  jcbModels.setSelectedIndex(0);
  jp1.add(jcbModels);
  jcbDimensions=new JComboBox();
  jcbDimensions.addItem("String_Node_Str");
  jcbDimensions.addItem("String_Node_Str");
  jp1.add(jcbDimensions);
  jcbTransposed=new JCheckBox("String_Node_Str",false);
  jp1.add(jcbTransposed);
  jcbPercent=new JCheckBox("String_Node_Str",false);
  jp1.add(jcbPercent);
  jcbLogarithmic=new JCheckBox("String_Node_Str",false);
  jp1.add(jcbLogarithmic);
  jbUpdate=new JButton("String_Node_Str");
  jbUpdate.addActionListener(this);
  jp1.add(jbUpdate);
  add(jp1);
}

Fixed version (ground truth):
ControlPanel(SwingChartViewerSelector scv){
  this.scv=scv;
  setLayout(new GridLayout(0,1,0,0));
  JPanel jp1=new JPanel();
  jp1.setLayout(new FlowLayout(FlowLayout.LEFT,5,5));
  jp1.add(new JLabel("String_Node_Str"));
  jcbModels=new JComboBox();
  String[] models=PrimitiveCharts.getAvailableModelList();
  for (int i=0; i < models.length; i++) {
    jcbModels.addItem(models[i]);
  }
  jcbModels.setSelectedIndex(0);
  jp1.add(jcbModels);
  jcbModels.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      int index=jcbModels.getSelectedIndex();
      if (index == 7) {
        jcbTransposed.setSelected(false);
        jcbTransposed.setEnabled(false);
        jcbLogarithmic.setEnabled(true);
      }
 else       if (index == 10) {
        jcbTransposed.setEnabled(true);
        jcbLogarithmic.setSelected(false);
        jcbLogarithmic.setEnabled(false);
      }
 else {
        jcbTransposed.setEnabled(true);
        jcbLogarithmic.setEnabled(true);
      }
    }
  }
);
  jcbDimensions=new JComboBox();
  jcbDimensions.addItem("String_Node_Str");
  jcbDimensions.addItem("String_Node_Str");
  jp1.add(jcbDimensions);
  jcbTransposed=new JCheckBox("String_Node_Str",false);
  jp1.add(jcbTransposed);
  jcbPercent=new JCheckBox("String_Node_Str",false);
  jp1.add(jcbPercent);
  jcbLogarithmic=new JCheckBox("String_Node_Str",false);
  jp1.add(jcbLogarithmic);
  jbUpdate=new JButton("String_Node_Str");
  jbUpdate.addActionListener(this);
  jp1.add(jbUpdate);
  add(jp1);
}
Program: 66782
Project: 66782
Buggy source:
public static String formatDateTime(String format,ULocale locale){
  String language=locale.getLanguage();
  String code=locale2Code.get(locale);
  if (code == null) {
    code=locale2Code.get(new Locale(language));
  }
  if (code == null) {
    return format;
  }
  return code + format;
}

Fixed version (ground truth):
public static String formatDateTime(String format,ULocale locale){
  String code=locale2Code.get(locale);
  if (code == null) {
    String language=locale.getLanguage();
    code=locale2Code.get(new ULocale(language,"String_Node_Str"));
  }
  if (code == null) {
    return format;
  }
  return code + format;
}
Program: 66783
Project: 66783
Buggy source:
public ImageData(String uri,String altText,int imageWidth,int imageHeight,StyleEntry styleId,int datatype,OdsContainer currentContainer){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=imageHeight / 1000;
  this.imageHeight=(int)height;
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  this.altText=altText;
  imageUrl=uri;
  rowSpanInDesign=0;
}

Fixed version (ground truth):
public ImageData(String uri,String altText,int imageWidth,int imageHeight,StyleEntry styleId,int datatype,OdsContainer currentContainer){
  super();
  this.dataType=datatype;
  this.styleId=styleId;
  height=imageHeight / 1000f;
  this.imageHeight=(int)height;
  width=Math.min(currentContainer.getSizeInfo().getWidth(),imageWidth);
  this.altText=altText;
  imageUrl=uri;
  rowSpanInDesign=0;
}
Program: 66784
Project: 66784
Buggy source:
protected void writeTableRow(IRowContent row,StyleEntry tableStyle){
  StyleEntry rowStyle=StyleBuilder.createStyleEntry(row.getComputedStyle(),StyleConstant.TYPE_TABLE_ROW);
  if (rowStyle != null && tableStyle != null) {
    StyleBuilder.mergeInheritableProp(tableStyle,rowStyle);
  }
  Collection list=row.getChildren();
  Iterator iter=list.iterator();
  int cellCount=list.size();
  int currentCellCount=0;
  while (iter.hasNext()) {
    currentCellCount++;
    ICellContent child=(ICellContent)iter.next();
    String tag="String_Node_Str";
switch (currentCellCount) {
case 1:
      tag="String_Node_Str";
    break;
case 2:
  tag="String_Node_Str";
break;
case 3:
tag="String_Node_Str";
break;
default :
break;
}
writer.openTag(tag);
writeTableCell(child,rowStyle);
writer.closeTag(tag);
}
}

Fixed version (ground truth):
protected void writeTableRow(IRowContent row,StyleEntry tableStyle){
  StyleEntry rowStyle=StyleBuilder.createStyleEntry(row.getComputedStyle(),StyleConstant.TYPE_TABLE_ROW);
  if (rowStyle != null && tableStyle != null) {
    StyleBuilder.mergeInheritableProp(tableStyle,rowStyle);
  }
  Collection list=row.getChildren();
  Iterator iter=list.iterator();
  int currentCellCount=0;
  while (iter.hasNext()) {
    currentCellCount++;
    ICellContent child=(ICellContent)iter.next();
    String tag="String_Node_Str";
switch (currentCellCount) {
case 1:
      tag="String_Node_Str";
    break;
case 2:
  tag="String_Node_Str";
break;
case 3:
tag="String_Node_Str";
break;
default :
break;
}
writer.openTag(tag);
writeTableCell(child,rowStyle);
writer.closeTag(tag);
}
}
Program: 66785
Project: 66785
Buggy source:
protected void writeTableCell(ICellContent cell,StyleEntry rowStyle){
  StringBuffer sb=new StringBuffer();
  Collection list=cell.getChildren();
  Iterator iter=list.iterator();
  if (iter.hasNext()) {
    StyleEntry cellStyle=StyleBuilder.createStyleEntry(cell.getComputedStyle(),StyleConstant.TYPE_TABLE_CELL);
    if (cellStyle != null && rowStyle != null) {
      StyleBuilder.mergeInheritableProp(cellStyle,rowStyle);
    }
    StyleEntry textStyle=StyleBuilder.createEmptyStyleEntry(StyleConstant.TYPE_TEXT);
    if (cellStyle != null) {
      StyleBuilder.mergeInheritableProp(textStyle,cellStyle);
    }
    writer.openTag("String_Node_Str");
    while (iter.hasNext()) {
      writeTextContent(iter.next(),textStyle);
    }
    writer.closeTag("String_Node_Str");
  }
}

Fixed version (ground truth):
protected void writeTableCell(ICellContent cell,StyleEntry rowStyle){
  Collection list=cell.getChildren();
  Iterator iter=list.iterator();
  if (iter.hasNext()) {
    StyleEntry cellStyle=StyleBuilder.createStyleEntry(cell.getComputedStyle(),StyleConstant.TYPE_TABLE_CELL);
    if (cellStyle != null && rowStyle != null) {
      StyleBuilder.mergeInheritableProp(cellStyle,rowStyle);
    }
    StyleEntry textStyle=StyleBuilder.createEmptyStyleEntry(StyleConstant.TYPE_TEXT);
    if (cellStyle != null) {
      StyleBuilder.mergeInheritableProp(textStyle,cellStyle);
    }
    writer.openTag("String_Node_Str");
    while (iter.hasNext()) {
      writeTextContent(iter.next(),textStyle);
    }
    writer.closeTag("String_Node_Str");
  }
}
Program: 66786
Project: 66786
Buggy source:
public void startTable(ITableContent table){
  XlsContainer currentContainer=getCurrentContainer();
  if (currentContainer == null) {
    addContainer(null);
    return;
  }
  ContainerSizeInfo sizeInfo=currentContainer.getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  boolean isAutoTable=true;
  int dpi=context.getDpi();
  if (isAutoTable) {
    info=LayoutUtil.createTable(table,width,dpi);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width,dpi),dpi);
    info=new ColumnsInfo(columns);
  }
  String caption=table.getCaption();
  if (caption != null) {
    addCaption(caption,table.getComputedStyle());
  }
  addTable(table,info,sizeInfo);
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  XlsContainer currentContainer=getCurrentContainer();
  if (currentContainer == null) {
    addContainer(null);
    return;
  }
  ContainerSizeInfo sizeInfo=currentContainer.getSizeInfo();
  int width=sizeInfo.getWidth();
  ColumnsInfo info=null;
  int dpi=context.getDpi();
  if (autoExtend()) {
    info=LayoutUtil.createTable(table,width,dpi);
  }
 else {
    int[] columns=LayoutUtil.createFixedTable(table,LayoutUtil.getElementWidth(table,width,dpi),dpi);
    info=new ColumnsInfo(columns);
  }
  String caption=table.getCaption();
  if (caption != null) {
    addCaption(caption,table.getComputedStyle());
  }
  addTable(table,info,sizeInfo);
}
Program: 66787
Project: 66787
Buggy source:
public void addTable(IContainerContent content,ColumnsInfo columns,ContainerSizeInfo size){
  IStyle style=content.getComputedStyle();
  XlsContainer currentContainer=getCurrentContainer();
  if (currentContainer == null) {
    addContainer(null);
    tables.push(null);
    return;
  }
  ContainerSizeInfo parentSizeInfo=currentContainer.getSizeInfo();
  boolean isTop=containers.size() == 1;
  boolean autoExtend=isTop && context.isAutoLayout();
  int[] columnStartCoordinates=splitColumns(columns,parentSizeInfo,autoExtend);
  createTable(columns,style,currentContainer,columnStartCoordinates);
}

Fixed version (ground truth):
public void addTable(IContainerContent content,ColumnsInfo columns,ContainerSizeInfo size){
  IStyle style=content.getComputedStyle();
  XlsContainer currentContainer=getCurrentContainer();
  if (currentContainer == null) {
    addContainer(null);
    tables.push(null);
    return;
  }
  ContainerSizeInfo parentSizeInfo=currentContainer.getSizeInfo();
  int[] columnStartCoordinates=splitColumns(columns,parentSizeInfo,autoExtend());
  createTable(columns,style,currentContainer,columnStartCoordinates);
}
Program: 66788
Project: 66788
Buggy source:
public static ColumnsInfo createTable(ITableContent table,int width,int dpi){
  int tableWidth=getElementWidth(table,width,dpi);
  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.convertDimensionType(value,tableWidth,dpi);
      totalAssigned+=columns[i];
    }
  }
  int leftWidth=tableWidth - totalAssigned;
  if (leftWidth < 0 && unassignedCount > 0) {
    int totalResized=0;
    int lastAssignedIndex=0;
    for (int i=0; i < columnCount; i++) {
      if (columns[i] == -1) {
        columns[i]=0;
      }
 else {
        columns[i]=resize(columns[i],totalAssigned,leftWidth);
        lastAssignedIndex=i;
      }
      totalResized+=columns[i];
    }
    columns[lastAssignedIndex]+=tableWidth - totalResized;
  }
 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 ColumnsInfo createTable(ITableContent table,int width,int dpi){
  int tableWidth=getElementWidth(table,width,dpi);
  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.convertDimensionType(value,tableWidth,dpi);
      totalAssigned+=columns[i];
    }
  }
  int leftWidth=tableWidth - totalAssigned;
  if (leftWidth > 0 && unassignedCount == 0 && table.getWidth() != null) {
    int totalResized=0;
    for (int i=0; i < columnCount - 1; i++) {
      columns[i]=resize(columns[i],totalAssigned,leftWidth);
      totalResized+=columns[i];
    }
    columns[columnCount - 1]=tableWidth - totalResized;
  }
 else   if (leftWidth < 0 && unassignedCount > 0) {
    int totalResized=0;
    int lastAssignedIndex=0;
    for (int i=0; i < columnCount; i++) {
      if (columns[i] == -1) {
        columns[i]=0;
      }
 else {
        columns[i]=resize(columns[i],totalAssigned,leftWidth);
        lastAssignedIndex=i;
      }
      totalResized+=columns[i];
    }
    columns[lastAssignedIndex]+=tableWidth - totalResized;
  }
 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);
}
Program: 66789
Project: 66789
Buggy source:
private boolean canSpan(SheetData data,XlsContainer rowContainer,int currentColumn,int lastColumn){
  SheetData realData=ExcelUtil.getRealData(data);
  if (realData == null)   return false;
  if (!isInContainer(realData,rowContainer)) {
    return false;
  }
  for (int i=currentColumn + 1; i < lastColumn; i++) {
    SheetData lastData=getColumnLastData(i);
    SheetData lastRealData=ExcelUtil.getRealData(lastData);
    if (lastRealData == null || lastRealData.getRowIndex() <= realData.getRowIndex()) {
      continue;
    }
    if (realData.getStartX() > lastRealData.getStartX()) {
      return false;
    }
  }
  return realData.getRowSpanInDesign() > 0;
}

Fixed version (ground truth):
private boolean canSpan(SheetData data,XlsContainer rowContainer,int currentColumn,int lastColumn){
  SheetData realData=ExcelUtil.getRealData(data);
  if (realData == null)   return false;
  if (!isInContainer(realData,rowContainer) && realData.getRowSpanInDesign() <= 0) {
    return false;
  }
  for (int i=currentColumn + 1; i < lastColumn; i++) {
    SheetData lastData=getColumnLastData(i);
    SheetData lastRealData=ExcelUtil.getRealData(lastData);
    if (lastRealData == null || lastRealData.getRowIndex() <= realData.getRowIndex()) {
      continue;
    }
    if (realData.getStartX() > lastRealData.getStartX()) {
      return false;
    }
  }
  return true;
}
Program: 66790
Project: 66790
Buggy source:
private void setupDirectories() throws IOException {
  String dataDir;
  if (sm_pluginFile != null && sm_manifestsDir != null)   return;
  if (sm_pluginTest) {
    IBundle dataBundle=Platform.getBundle("String_Node_Str");
    URL url=dataBundle.getEntry("String_Node_Str");
    dataDir=Platform.asLocalURL(url).getPath();
    IBundle driverBundle=Platform.getBundle(sm_dtpFlatfileId);
    URL jdbcUrl=driverBundle.getEntry("String_Node_Str");
    sm_pluginFile=Platform.asLocalURL(jdbcUrl).getPath() + sm_pluginFileName;
  }
 else {
    dataDir="String_Node_Str";
    sm_pluginFile=dataDir + "String_Node_Str" + sm_dtpFlatfileId+ "String_Node_Str"+ sm_pluginFileName;
    System.setProperty("String_Node_Str",dataDir + "String_Node_Str");
  }
  sm_manifestsDir=dataDir + "String_Node_Str" + sm_birtFlatfileId+ "String_Node_Str";
}

Fixed version (ground truth):
private void setupDirectories() throws IOException {
  String dataDir;
  if (sm_pluginFile != null && sm_manifestsDir != null)   return;
  if (sm_pluginTest) {
    Bundle dataBundle=org.eclipse.core.runtime.Platform.getBundle("String_Node_Str");
    URL url=dataBundle.getEntry("String_Node_Str");
    dataDir=org.eclipse.core.runtime.Platform.asLocalURL(url).getPath();
    Bundle driverBundle=org.eclipse.core.runtime.Platform.getBundle(sm_dtpFlatfileId);
    URL jdbcUrl=driverBundle.getEntry("String_Node_Str");
    sm_pluginFile=org.eclipse.core.runtime.Platform.asLocalURL(jdbcUrl).getPath() + sm_pluginFileName;
  }
 else {
    dataDir="String_Node_Str";
    sm_pluginFile=dataDir + "String_Node_Str" + sm_dtpFlatfileId+ "String_Node_Str"+ sm_pluginFileName;
    System.setProperty("String_Node_Str",dataDir + "String_Node_Str");
  }
  sm_manifestsDir=dataDir + "String_Node_Str" + sm_birtFlatfileId+ "String_Node_Str";
}
Program: 66791
Project: 66791
Buggy source:
public void defineCube(CubeHandle cubeHandle) throws BirtException {
  CubeHandleUtil.defineCube(dataEngine,cubeHandle,this.sessionContext.getAppContext());
  ICubeInterceptor interceptor=CubeInterceptorFinder.find(cubeHandle);
  if (interceptor != null) {
    interceptor.preDefineCube(this.sessionContext.getAppContext(),cubeHandle);
  }
  if (interceptor == null || interceptor.needDefineCube()) {
    Set involvedDataSets=getInvolvedDataSets((TabularCubeHandle)cubeHandle);
    Iterator itr=involvedDataSets.iterator();
    while (itr.hasNext()) {
      DataSetHandle dsHandle=(DataSetHandle)itr.next();
      BaseDataSourceDesign baseDataSource=this.modelAdaptor.adaptDataSource(dsHandle.getDataSource());
      BaseDataSetDesign baseDataSet=this.modelAdaptor.adaptDataSet(dsHandle);
      if (baseDataSource != null && this.dataEngine.getDataSourceRuntime(baseDataSource.getName()) == null)       this.defineDataSource(baseDataSource);
      if (this.dataEngine.getDataSetDesign(baseDataSet.getName()) == null) {
        DefineDataSourceSetUtil.defineDataSourceAndDataSet(dsHandle,this);
      }
    }
    if (!cubeHandleMap.containsKey(cubeHandle.getQualifiedName())) {
      this.cubeHandleMap.put(cubeHandle.getQualifiedName(),cubeHandle);
    }
    prepareForCubeGeneration((TabularCubeHandle)cubeHandle);
  }
}

Fixed version (ground truth):
public void defineCube(CubeHandle cubeHandle) throws BirtException {
  CubeHandleUtil.defineCube(dataEngine,cubeHandle,this.sessionContext.getAppContext());
  ICubeInterceptor cubeInterceptor=CubeInterceptorFinder.find(cubeHandle);
  if (cubeInterceptor != null) {
    cubeInterceptor.preDefineCube(this.sessionContext.getAppContext(),cubeHandle);
    if (this.cubeInterceptorList == null) {
      this.cubeInterceptorList=new ArrayList<ICubeInterceptor>();
    }
    this.cubeInterceptorList.add(cubeInterceptor);
  }
  if (cubeInterceptor == null || cubeInterceptor.needDefineCube()) {
    Set involvedDataSets=getInvolvedDataSets((TabularCubeHandle)cubeHandle);
    Iterator itr=involvedDataSets.iterator();
    while (itr.hasNext()) {
      DataSetHandle dsHandle=(DataSetHandle)itr.next();
      BaseDataSourceDesign baseDataSource=this.modelAdaptor.adaptDataSource(dsHandle.getDataSource());
      BaseDataSetDesign baseDataSet=this.modelAdaptor.adaptDataSet(dsHandle);
      if (baseDataSource != null && this.dataEngine.getDataSourceRuntime(baseDataSource.getName()) == null)       this.defineDataSource(baseDataSource);
      if (this.dataEngine.getDataSetDesign(baseDataSet.getName()) == null) {
        DefineDataSourceSetUtil.defineDataSourceAndDataSet(dsHandle,this);
      }
    }
    if (!cubeHandleMap.containsKey(cubeHandle.getQualifiedName())) {
      this.cubeHandleMap.put(cubeHandle.getQualifiedName(),cubeHandle);
    }
    prepareForCubeGeneration((TabularCubeHandle)cubeHandle);
  }
}
Program: 66792
Project: 66792
Buggy source:
public void shutdown(){
  if (cubeMaterializer != null) {
    try {
      cubeMaterializer.close();
    }
 catch (    IOException e) {
      logger.log(Level.WARNING,e.getLocalizedMessage(),e);
    }
  }
  DataSessionFinalizeUtil.finalize(this);
  if (dataEngine != null) {
    dataEngine.shutdown();
    dataEngine=null;
  }
}

Fixed version (ground truth):
public void shutdown(){
  if (cubeMaterializer != null) {
    try {
      cubeMaterializer.close();
    }
 catch (    IOException e) {
      logger.log(Level.WARNING,e.getLocalizedMessage(),e);
    }
  }
  DataSessionFinalizeUtil.finalize(this);
  if (dataEngine != null) {
    dataEngine.shutdown();
    dataEngine=null;
  }
  if (this.dataSetInterceptorList != null || this.cubeInterceptorList != null) {
    try {
      AppContextResourceReleaser.release(this.sessionContext.getAppContext());
    }
 catch (    BirtException e) {
    }
  }
}
Program: 66793
Project: 66793
Buggy source:
public void defineDataSet(IBaseDataSetDesign design) throws BirtException {
  IDataSetInterceptor interceptor=DataSetInterceptorFinder.find(design);
  if (interceptor != null) {
    interceptor.preDefineDataSet(sessionContext.getAppContext(),dataEngine.getDataSourceDesign(design.getDataSourceName()),design,getDataSessionContext().getModuleHandle());
  }
  dataEngine.defineDataSet(design);
}

Fixed version (ground truth):
public void defineDataSet(IBaseDataSetDesign design) throws BirtException {
  IDataSetInterceptor dataSetInterceptor=DataSetInterceptorFinder.find(design);
  if (dataSetInterceptor != null) {
    dataSetInterceptor.preDefineDataSet(sessionContext.getAppContext(),dataEngine.getDataSourceDesign(design.getDataSourceName()),design,getDataSessionContext().getModuleHandle());
    if (this.dataSetInterceptorList == null) {
      this.dataSetInterceptorList=new ArrayList<IDataSetInterceptor>();
    }
    this.dataSetInterceptorList.add(dataSetInterceptor);
  }
  dataEngine.defineDataSet(design);
}
Program: 66794
Project: 66794
Buggy source:
private void fillRightSide(int lindex){
  int index=lindex;
  double x=loa[index].getX();
  double y=loa[index].getY();
  loaPlane[0].set(x,y);
  loaPlane[1].set(x + dTapeWidth,y - dTapeWidth);
  double lastLocation=loaLast == null ? zeroLocation : trans.getY(loaLast[index]);
  if (trans == Transposition.TRANSPOSED) {
    loaPlane[2].set(lastLocation + dTapeWidth,y - dTapeWidth);
    loaPlane[3].set(lastLocation,y);
  }
 else {
    loaPlane[2].set(x + dTapeWidth,lastLocation - dTapeWidth);
    loaPlane[3].set(x,lastLocation);
  }
  pre.setOutline(null);
  pre.setBackground(sideColor);
  pre.setPoints(loaPlane);
  pre.setSourceObject(createDataPointSource(index));
  dc.addPlane(pre,PrimitiveRenderEvent.FILL);
}

Fixed version (ground truth):
private void fillRightSide(int lindex){
  int index=lindex;
  double x=loa[index].getX();
  double y=loa[index].getY();
  loaPlane[0].set(x,y);
  loaPlane[1].set(x + dTapeWidth,y - dTapeWidth);
  double lastLocation=loaLast == null ? zeroLocation : trans.getY(loaLast[loaLast.length - (loa.length - index)]);
  if (trans == Transposition.TRANSPOSED) {
    loaPlane[2].set(lastLocation + dTapeWidth,y - dTapeWidth);
    loaPlane[3].set(lastLocation,y);
  }
 else {
    loaPlane[2].set(x + dTapeWidth,lastLocation - dTapeWidth);
    loaPlane[3].set(x,lastLocation);
  }
  pre.setOutline(null);
  pre.setBackground(sideColor);
  pre.setPoints(loaPlane);
  pre.setSourceObject(createDataPointSource(index));
  dc.addPlane(pre,PrimitiveRenderEvent.FILL);
}
Program: 66795
Project: 66795
Buggy source:
@Override protected void saveStates(){
  RunTimeContext rtc=context.line.getRunTimeContext();
  if (context.line.isLastRuntimeSeriesInAxis()) {
    rtc.putState(STACKED_SERIES_LOCATION_KEY,null);
    rtc.putState(AREA_ENVELOPS,null);
  }
 else {
    rtc.putState(STACKED_SERIES_LOCATION_KEY,loa);
    rtc.putState(AREA_ENVELOPS,envelops);
  }
}

Fixed version (ground truth):
@Override protected void saveStates(){
  RunTimeContext rtc=context.line.getRunTimeContext();
  if (context.line.isLastRuntimeSeriesInAxis()) {
    rtc.putState(STACKED_SERIES_LOCATION_KEY,null);
    rtc.putState(AREA_ENVELOPS,null);
  }
 else {
    List<double[]> list=new ArrayList<double[]>();
    for (    Location lo : loa) {
      double[] l=new double[]{lo.getX(),lo.getY()};
      list.add(l);
    }
    rtc.putState(STACKED_SERIES_LOCATION_KEY,list);
    rtc.putState(AREA_ENVELOPS,envelops);
  }
}
Program: 66798
Project: 66798
Buggy source:
public DataInteractiveEngine(DataEngineFactory factory,ExecutionContext context,IDocArchiveReader reader,IDocArchiveWriter writer) throws Exception {
  super(factory,context);
  this.writer=writer;
  this.reader=reader;
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_UPDATE,null,context.getScriptContext(),context.getApplicationClassLoader());
  dteSessionContext.setDocumentReader(reader);
  dteSessionContext.setDocumentWriter(writer);
  dteSessionContext.setAppContext(context.getAppContext());
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  dteEngineContext.setTimeZone(context.getTimeZone());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  initialize();
}

Fixed version (ground truth):
public DataInteractiveEngine(DataEngineFactory factory,ExecutionContext context,IDocArchiveReader reader,IDocArchiveWriter writer) throws Exception {
  super(factory,context);
  this.writer=writer;
  this.reader=reader;
  DataSessionContext dteSessionContext=new DataSessionContext(DataSessionContext.MODE_UPDATE,context.getDesign(),context.getScriptContext(),context.getApplicationClassLoader());
  dteSessionContext.setDocumentReader(reader);
  dteSessionContext.setDocumentWriter(writer);
  dteSessionContext.setAppContext(context.getAppContext());
  DataEngineContext dteEngineContext=dteSessionContext.getDataEngineContext();
  dteEngineContext.setLocale(context.getLocale());
  dteEngineContext.setTimeZone(context.getTimeZone());
  String tempDir=getTempDir(context);
  if (tempDir != null) {
    dteEngineContext.setTmpdir(tempDir);
  }
  dteSession=DataRequestSession.newSession(dteSessionContext);
  initialize();
}
Program: 66799
Project: 66799
Buggy source:
/** 
 * Return pre-defined query text pattern with every element in a cell.
 * @return pre-defined query text
 */
public static String getQueryPresetTextString(String extensionId){
  String[] lines=getQueryPresetTextArray(extensionId);
  String result="String_Node_Str";
  if (lines != null && lines.length > 0) {
    for (int i=0; i < lines.length; i++) {
      result=result + lines[i] + (i == lines.length - 1 ? "String_Node_Str" : "String_Node_Str");
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Return pre-defined query text pattern with every element in a cell.
 * @return pre-defined query text
 */
public static String getQueryPresetTextString(String extensionId){
  String[] lines=getQueryPresetTextArray(extensionId);
  StringBuffer result=new StringBuffer();
  if (lines != null && lines.length > 0) {
    for (int i=0; i < lines.length; i++) {
      result.append(lines[i]).append(i == lines.length - 1 ? "String_Node_Str" : "String_Node_Str");
    }
  }
  return result.toString();
}
Program: 66800
Project: 66800
Buggy source:
public ResultSet getAlltables(String schemaPattern,String namePattern,String[] types){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
  try {
    return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
    }
 catch (    Exception e1) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
}

Fixed version (ground truth):
public ResultSet getAlltables(String schemaPattern,String namePattern,String[] types){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
  try {
    return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getTables(connection.getCatalog(),schemaPattern,namePattern,types);
    }
 catch (    SQLException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      return null;
    }
catch (    OdaException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      return null;
    }
  }
}
Program: 66801
Project: 66801
Buggy source:
public ResultSet getTableColumns(String schemaPattern,String tableNamePattern,String columnNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
  try {
    return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
    }
 catch (    Exception e1) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
}

Fixed version (ground truth):
public ResultSet getTableColumns(String schemaPattern,String tableNamePattern,String columnNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
  try {
    return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getColumns(connection.getCatalog(),schemaPattern,tableNamePattern,columnNamePattern);
    }
 catch (    SQLException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
catch (    OdaException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
  }
}
Program: 66802
Project: 66802
Buggy source:
public ResultSet getProcedureColumns(String schemaPattern,String procedureNamePattern,String columnNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
  try {
    return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
    }
 catch (    Exception e1) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
}

Fixed version (ground truth):
public ResultSet getProcedureColumns(String schemaPattern,String procedureNamePattern,String columnNamePattern){
  if (connection == null) {
    try {
      reconnect();
    }
 catch (    Exception e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
    try {
      return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
      return null;
    }
  }
  try {
    return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
  }
 catch (  SQLException e) {
    try {
      reconnect();
      return connection.getMetaData().getProcedureColumns(connection.getCatalog(),schemaPattern,procedureNamePattern,columnNamePattern);
    }
 catch (    SQLException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
catch (    OdaException e1) {
      logger.log(Level.WARNING,e1.getMessage(),e1);
      return null;
    }
  }
}
Program: 66803
Project: 66803
Buggy source:
/** 
 * Return the String which stands for the type specified by input argument
 * @param typeName the int value of a Type
 * @return the String which stands for the type specified by input typeName
 * @throws OdaException Once the input arguement is not a valid type name
 */
public static String getTypeString(int type) throws OdaException {
  Integer typeInteger=new Integer(type);
  if (typeIntStringPair.containsKey(typeInteger))   return typeIntStringPair.get(typeInteger).toString();
  throw new OdaException();
}

Fixed version (ground truth):
/** 
 * Return the String which stands for the type specified by input argument
 * @param typeName the int value of a Type
 * @return the String which stands for the type specified by input typeName
 * @throws OdaException Once the input arguement is not a valid type name
 */
public static String getTypeString(int type) throws OdaException {
  Integer typeInteger=Integer.valueOf(type);
  if (typeIntStringPair.containsKey(typeInteger))   return typeIntStringPair.get(typeInteger).toString();
  throw new OdaException();
}
Program: 66804
Project: 66804
Buggy source:
public static IArchiveLockManager getInstance(){
  if (instance != null) {
    return instance;
  }
synchronized (ArchiveLockManager.class) {
    if (instance == null) {
      instance=new DocArchiveLockManager();
    }
  }
  return instance;
}

Fixed version (ground truth):
public static IArchiveLockManager getInstance(){
  return ManagerHolder.instance;
}
Program: 66805
Project: 66805
Buggy source:
private void ensureFileOpened() throws IOException {
  if (rf != null) {
    return;
  }
synchronized (this) {
    if (rf == null) {
      ensureParentFolderCreated(fileName);
      rf=new RandomAccessFile(fileName,"String_Node_Str");
      rf.setLength(0);
    }
  }
}

Fixed version (ground truth):
private void ensureFileOpened() throws IOException {
  if (rf == null) {
synchronized (this) {
      if (rf == null) {
        ensureParentFolderCreated(fileName);
        rf=new RandomAccessFile(fileName,"String_Node_Str");
        rf.setLength(0);
      }
    }
  }
}
Program: 66806
Project: 66806
Buggy source:
/** 
 * get the trace logger handle. Trace logger handle output all the logging information to System.out
 * @return
 */
static StreamHandler getTracingHandler(){
  if (tracingHandler == null) {
    tracingHandler=new StreamHandler(System.out,new SimpleFormatter());
    tracingHandler.setLevel(Level.ALL);
  }
  return tracingHandler;
}

Fixed version (ground truth):
/** 
 * get the trace logger handle. Trace logger handle output all the logging information to System.out
 * @return
 */
static StreamHandler getTracingHandler(){
  return TracingHandlerHolder.tracingHandler;
}
Program: 66807
Project: 66807
Buggy source:
void preDefineCube(DataEngineImpl dataEngine,Map appContext,CubeHandle handle) throws BirtException ;

Fixed version (ground truth):
void preDefineCube(Map appContext,CubeHandle handle) throws BirtException ;
Program: 66808
Project: 66808
Buggy source:
public static boolean defineCube(DataEngineImpl dataEngine,CubeHandle handle,Map appContext) throws BirtException {
  return false;
}

Fixed version (ground truth):
public static void defineCube(DataEngineImpl dataEngine,CubeHandle handle,Map appContext) throws BirtException {
}
Program: 66809
Project: 66809
Buggy source:
public void defineCube(CubeHandle cubeHandle) throws BirtException {
  if (CubeHandleUtil.defineCube(this.dataEngine,cubeHandle,this.sessionContext.getAppContext()))   return;
  Set involvedDataSets=getInvolvedDataSets((TabularCubeHandle)cubeHandle);
  Iterator itr=involvedDataSets.iterator();
  while (itr.hasNext()) {
    DataSetHandle dsHandle=(DataSetHandle)itr.next();
    BaseDataSourceDesign baseDataSource=this.modelAdaptor.adaptDataSource(dsHandle.getDataSource());
    BaseDataSetDesign baseDataSet=this.modelAdaptor.adaptDataSet(dsHandle);
    if (baseDataSource != null && this.dataEngine.getDataSourceRuntime(baseDataSource.getName()) == null)     this.defineDataSource(baseDataSource);
    if (this.dataEngine.getDataSetDesign(baseDataSet.getName()) == null) {
      DefineDataSourceSetUtil.defineDataSourceAndDataSet(dsHandle,this);
    }
  }
  if (!cubeHandleMap.containsKey(cubeHandle.getQualifiedName())) {
    this.cubeHandleMap.put(cubeHandle.getQualifiedName(),cubeHandle);
  }
  prepareForCubeGeneration((TabularCubeHandle)cubeHandle);
}

Fixed version (ground truth):
public void defineCube(CubeHandle cubeHandle) throws BirtException {
  CubeHandleUtil.defineCube(dataEngine,cubeHandle,this.sessionContext.getAppContext());
  ICubeInterceptor interceptor=CubeInterceptorFinder.find(cubeHandle);
  if (interceptor != null) {
    interceptor.preDefineCube(this.sessionContext.getAppContext(),cubeHandle);
  }
  if (interceptor == null || interceptor.needDefineCube()) {
    Set involvedDataSets=getInvolvedDataSets((TabularCubeHandle)cubeHandle);
    Iterator itr=involvedDataSets.iterator();
    while (itr.hasNext()) {
      DataSetHandle dsHandle=(DataSetHandle)itr.next();
      BaseDataSourceDesign baseDataSource=this.modelAdaptor.adaptDataSource(dsHandle.getDataSource());
      BaseDataSetDesign baseDataSet=this.modelAdaptor.adaptDataSet(dsHandle);
      if (baseDataSource != null && this.dataEngine.getDataSourceRuntime(baseDataSource.getName()) == null)       this.defineDataSource(baseDataSource);
      if (this.dataEngine.getDataSetDesign(baseDataSet.getName()) == null) {
        DefineDataSourceSetUtil.defineDataSourceAndDataSet(dsHandle,this);
      }
    }
    if (!cubeHandleMap.containsKey(cubeHandle.getQualifiedName())) {
      this.cubeHandleMap.put(cubeHandle.getQualifiedName(),cubeHandle);
    }
    prepareForCubeGeneration((TabularCubeHandle)cubeHandle);
  }
}
Program: 66810
Project: 66810
Buggy source:
public void shutdown(){
  if (cubeMaterializer != null) {
    try {
      cubeMaterializer.close();
    }
 catch (    IOException e) {
      logger.log(Level.WARNING,e.getLocalizedMessage(),e);
    }
  }
  DataSessionFinalizeUtil.finalize(this);
  try {
    AppContextResourceReleaser.release(this.getDataSessionContext().getAppContext());
  }
 catch (  BirtException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage(),e);
  }
  if (dataEngine != null) {
    dataEngine.shutdown();
    dataEngine=null;
  }
}

Fixed version (ground truth):
public void shutdown(){
  if (cubeMaterializer != null) {
    try {
      cubeMaterializer.close();
    }
 catch (    IOException e) {
      logger.log(Level.WARNING,e.getLocalizedMessage(),e);
    }
  }
  DataSessionFinalizeUtil.finalize(this);
  if (dataEngine != null) {
    dataEngine.shutdown();
    dataEngine=null;
  }
}
Program: 66811
Project: 66811
Buggy source:
public void defineDataSet(IBaseDataSetDesign design) throws BirtException {
  if (design.getDataSourceName() != null) {
    TransientDataMartUtil.prepareDataSet(sessionContext.getAppContext(),sessionContext.getDataEngineContext(),dataEngine.getDataSourceDesign(design.getDataSourceName()),design,this);
  }
  dataEngine.defineDataSet(design);
}

Fixed version (ground truth):
public void defineDataSet(IBaseDataSetDesign design) throws BirtException {
  IDataSetInterceptor interceptor=DataSetInterceptorFinder.find(design);
  if (interceptor != null) {
    interceptor.preDefineDataSet(sessionContext.getAppContext(),dataEngine.getDataSourceDesign(design.getDataSourceName()),design,getDataSessionContext().getModuleHandle());
  }
  dataEngine.defineDataSet(design);
}
Program: 66813
Project: 66813
Buggy source:
/** 
 */
private void initCache(){
  needCache=true;
  TempPathManager.setTempPath(this.session.getTempDir());
  cache=new BufferedStructureArray(SimpleCachedObject.getCreator(),0);
}

Fixed version (ground truth):
/** 
 */
private void initCache(){
  needCache=true;
  DataEngineThreadLocal.getInstance().getPathManager().setTempPath(this.session.getTempDir());
  cache=new BufferedStructureArray(SimpleCachedObject.getCreator(),0);
}
Program: 66815
Project: 66815
Buggy source:
/** 
 * Create a file for caching objects.
 * @param cacheIndex
 * @return
 * @throws IOException
 */
private void createCacheFile() throws IOException {
  String tempFileStr=TempPathManager.getTempFileName(fileNamePrefix,this.hashCode(),"String_Node_Str");
  if (diskFile == null) {
    diskFile=new File(tempFileStr);
    FileSecurity.createNewFile(diskFile);
  }
}

Fixed version (ground truth):
/** 
 * Create a file for caching objects.
 * @param cacheIndex
 * @return
 * @throws IOException
 */
private void createCacheFile() throws IOException {
  String tempFileStr=DataEngineThreadLocal.getInstance().getPathManager().getTempFileName(fileNamePrefix,this.hashCode(),"String_Node_Str");
  if (diskFile == null) {
    diskFile=new File(tempFileStr);
    FileSecurity.createNewFile(diskFile);
  }
}