nus-yam/ex-repair huggingface dataset:
Program: 76841
Project: 76841
Buggy source:
/** 
 * @param rowExprsIs
 * @param rowLenIs
 * @throws DataException
 */
private void initialize(RAInputStream rowExprsIs,RAInputStream rowLenIs,int rowCount) throws DataException {
  try {
    IOUtil.readInt(rowExprsIs);
    int exprCount=IOUtil.readInt(rowExprsIs);
    this.exprKeys=new ArrayList();
    this.rowExprsDis=new DataInputStream(rowExprsIs);
    for (int i=0; i < exprCount; i++) {
      this.exprKeys.add(IOUtil.readString(this.rowExprsDis));
    }
    this.metaOffset=IOUtil.INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + IOUtil.INT_LENGTH;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsIs=rowExprsIs;
  this.rowLenIs=rowLenIs;
  this.currRowIndex=-1;
  this.lastRowIndex=-1;
  this.currRowLenReadIndex=-1;
  this.rowCount=rowCount;
  this.rowIDMap=new BasicCachedArray(rowCount);
}

Fixed version (ground truth):
/** 
 * @param rowExprsIs
 * @param rowLenIs
 * @throws DataException
 */
private void initialize(RAInputStream rowExprsIs,RAInputStream rowLenIs,int rowCount) throws DataException {
  try {
    IOUtil.readInt(rowExprsIs);
    int exprCount=IOUtil.readInt(rowExprsIs);
    this.exprKeys=new ArrayList();
    this.rowExprsDis=new DataInputStream(rowExprsIs);
    for (int i=0; i < exprCount; i++) {
      this.exprKeys.add(IOUtil.readString(this.rowExprsDis));
    }
    this.metaOffset=IOUtil.INT_LENGTH + IOUtil.readInt(this.rowExprsDis) + IOUtil.INT_LENGTH;
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_LOAD_ERROR,e,"String_Node_Str");
  }
  this.rowExprsIs=rowExprsIs;
  this.rowLenIs=rowLenIs;
  this.currRowIndex=-1;
  this.lastRowIndex=-1;
  this.currRowLenReadIndex=0;
  this.rowCount=rowCount;
  this.rowIDMap=new BasicCachedArray(rowCount);
}
Program: 76842
Project: 76842
Buggy source:
/** 
 * @param modelDataSet
 * @param dteDataSet
 */
private static void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if (!modelColumn.getColumnName().equals(modelColumn.getNativeName()))         dteDataSet.addResultSetHint(new ColumnAdapter((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(new ColumnAdapter(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(new ColumnAdapter(modelColumnHint));
    }
  }
}

Fixed version (ground truth):
/** 
 * @param modelDataSet
 * @param dteDataSet
 */
private static void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if (!modelColumn.getColumnName().equals(modelColumn.getNativeName()))         dteDataSet.addResultSetHint(new ColumnAdapter((ResultSetColumnHandle)modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.resultSetHintsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
      dteDataSet.addResultSetHint(new ColumnAdapter(modelColumn));
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(new ColumnAdapter(modelColumnHint));
    }
  }
}
Program: 76843
Project: 76843
Buggy source:
/** 
 */
private void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter=null;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if (!modelColumn.getColumnName().equals(modelColumn.getNativeName()))         dteDataSet.addResultSetHint(newColumnDefn((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(newColumnDefn(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(newColumnDefn(modelColumnHint));
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter=null;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if (!modelColumn.getColumnName().equals(modelColumn.getNativeName()))         dteDataSet.addResultSetHint(newColumnDefn((ResultSetColumnHandle)modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.resultSetHintsIterator();
  if (elmtIter != null) {
    while (elmtIter.hasNext()) {
      ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
      dteDataSet.addResultSetHint(newColumnDefn(modelColumn));
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(newColumnDefn(modelColumnHint));
    }
  }
}
Program: 76844
Project: 76844
Buggy source:
protected void writeSimpleMasterPage(DataOutputStream out,SimpleMasterPageDesign design) throws IOException {
  writeMasterPage(out,design);
  boolean showHeaderOnFirst=design.isShowHeaderOnFirst();
  if (showHeaderOnFirst) {
    IOUtil.writeShort(out,FIELD_SHOW_HEADER_ON_FIRST);
    IOUtil.writeBool(out,showHeaderOnFirst);
  }
  boolean showFooterOnLast=design.isShowFooterOnLast();
  if (showFooterOnLast) {
    IOUtil.writeShort(out,FIELD_SHOW_FOOTER_ON_LAST);
    IOUtil.writeBool(out,showFooterOnLast);
  }
  boolean floatingFooter=design.isFloatingFooter();
  if (floatingFooter) {
    IOUtil.writeShort(out,FIELD_FLOATING_FOOTER);
    IOUtil.writeBool(out,floatingFooter);
  }
  DimensionType headerHeight=design.getHeaderHeight();
  if (headerHeight != null) {
    IOUtil.writeShort(out,FEILD_HEADER_HEIGHT);
    writeDimension(out,headerHeight);
  }
  DimensionType footerHeigh=design.getFooterHeight();
  if (footerHeigh != null) {
    IOUtil.writeShort(out,FEILD_FOOTER_HEIGHT);
    writeDimension(out,footerHeigh);
  }
}

Fixed version (ground truth):
protected void writeSimpleMasterPage(DataOutputStream out,SimpleMasterPageDesign design) throws IOException {
  writeMasterPage(out,design);
  boolean showHeaderOnFirst=design.isShowHeaderOnFirst();
  if (!showHeaderOnFirst) {
    IOUtil.writeShort(out,FIELD_SHOW_HEADER_ON_FIRST);
    IOUtil.writeBool(out,showHeaderOnFirst);
  }
  boolean showFooterOnLast=design.isShowFooterOnLast();
  if (!showFooterOnLast) {
    IOUtil.writeShort(out,FIELD_SHOW_FOOTER_ON_LAST);
    IOUtil.writeBool(out,showFooterOnLast);
  }
  boolean floatingFooter=design.isFloatingFooter();
  if (floatingFooter) {
    IOUtil.writeShort(out,FIELD_FLOATING_FOOTER);
    IOUtil.writeBool(out,floatingFooter);
  }
  DimensionType headerHeight=design.getHeaderHeight();
  if (headerHeight != null) {
    IOUtil.writeShort(out,FEILD_HEADER_HEIGHT);
    writeDimension(out,headerHeight);
  }
  DimensionType footerHeigh=design.getFooterHeight();
  if (footerHeigh != null) {
    IOUtil.writeShort(out,FEILD_FOOTER_HEIGHT);
    writeDimension(out,footerHeigh);
  }
}
Program: 76846
Project: 76846
Buggy source:
/** 
 * Reusable 'strokes' for rendering lines may be obtained from here
 * @param ls
 * @return
 */
public final Stroke getCachedStroke(LineAttributes lia){
  if (lia == null)   return null;
  Stroke s=(Stroke)_htLineStyles.get(lia);
  if (s == null) {
    BasicStroke bs=null;
    if (lia.getStyle().getValue() == LineStyle.DASHED) {
      float[] faStyle=new float[]{6.0f,4.0f};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.DOTTED) {
      float[] faStyle=new float[]{1.0f,4.0f};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.DASH_DOTTED) {
      float[] faStyle=new float[]{6.0f,4.0f,1.0f,4.0f};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.SOLID) {
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND);
    }
    if (bs != null) {
      _htLineStyles.put(lia,bs);
    }
    return bs;
  }
  return s;
}

Fixed version (ground truth):
/** 
 * Reusable 'strokes' for rendering lines may be obtained from here
 * @param ls
 * @return
 */
public final Stroke getCachedStroke(LineAttributes lia){
  if (lia == null)   return null;
  Stroke s=(Stroke)_htLineStyles.get(lia);
  if (s == null) {
    BasicStroke bs=null;
    if (lia.getStyle().getValue() == LineStyle.DASHED) {
      float[] faStyle=new float[]{6.0f,4.0f};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.DOTTED) {
      float[] faStyle=new float[]{1.0f,4.0f};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.DASH_DOTTED) {
      float[] faStyle=new float[]{6.0f,4.0f,1.0f,4.0f};
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND,0,faStyle,0);
    }
 else     if (lia.getStyle().getValue() == LineStyle.SOLID) {
      bs=new BasicStroke(lia.getThickness(),BasicStroke.CAP_SQUARE,BasicStroke.JOIN_MITER);
    }
    if (bs != null) {
      _htLineStyles.put(lia,bs);
    }
    return bs;
  }
  return s;
}
Program: 76847
Project: 76847
Buggy source:
/** 
 * @param modelDataSet
 * @param dteDataSet
 */
private static void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if ((!modelColumn.getColumnName().equals(modelColumn.getNativeName())) || modelColumn.getNativeDataType() == null)         dteDataSet.addResultSetHint(new ColumnAdapter((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(new ColumnAdapter(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(new ColumnAdapter(modelColumnHint));
    }
  }
}

Fixed version (ground truth):
/** 
 * @param modelDataSet
 * @param dteDataSet
 */
private static void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if (!modelColumn.getColumnName().equals(modelColumn.getNativeName()))         dteDataSet.addResultSetHint(new ColumnAdapter((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(new ColumnAdapter(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(new ColumnAdapter(modelColumnHint));
    }
  }
}
Program: 76848
Project: 76848
Buggy source:
/** 
 */
private void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter=null;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if ((!modelColumn.getColumnName().equals(modelColumn.getNativeName())) || modelColumn.getNativeDataType() == null)         dteDataSet.addResultSetHint(newColumnDefn((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(newColumnDefn(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(newColumnDefn(modelColumnHint));
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter=null;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if (!modelColumn.getColumnName().equals(modelColumn.getNativeName()))         dteDataSet.addResultSetHint(newColumnDefn((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(newColumnDefn(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(newColumnDefn(modelColumnHint));
    }
  }
}
Program: 76849
Project: 76849
Buggy source:
protected boolean traverseChildren(){
  if (lines.isEmpty()) {
    traverseSingleChild();
  }
  if (!layoutLines()) {
    clearCache();
    return false;
  }
  return true;
}

Fixed version (ground truth):
protected boolean traverseChildren(){
  if (!finished) {
    if (!traverseSingleChild()) {
      finished=true;
    }
 else {
      return true;
    }
  }
  if (!layoutLines()) {
    clearCache();
    return false;
  }
  return true;
}
Program: 76850
Project: 76850
Buggy source:
/** 
 * @param meta
 * @throws BirtException
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i - 1);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompatibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}

Fixed version (ground truth):
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i - 1);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompatibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}
Program: 76851
Project: 76851
Buggy source:
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    if (dataSetHandle == null) {
      throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
    }
    rsMeta=this.retrieveMetaDataByQueryExecution(dataSetHandle);
    if (!(dataSetHandle instanceof ScriptDataSetHandle))     clearUnusedData(dataSetHandle,rsMeta);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    List columnList=new ArrayList();
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        columnList.add(rsc);
      }
    }
    if (holdEvent || !dataSetHandle.canEdit()) {
      CompatibilityUtil.updateResultSetinCachedMetaData(dataSetHandle,columnList);
    }
 else {
      dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
      for (int i=0; i < columnList.size(); i++) {
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem((ResultSetColumn)columnList.get(i));
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    rsMeta=this.getDataSetMetaData(dataSetHandle,false);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    List columnList=new ArrayList();
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        columnList.add(rsc);
      }
    }
    if (holdEvent || !dataSetHandle.canEdit()) {
      CompatibilityUtil.updateResultSetinCachedMetaData(dataSetHandle,columnList);
    }
 else {
      dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
      for (int i=0; i < columnList.size(); i++) {
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem((ResultSetColumn)columnList.get(i));
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}
Program: 76852
Project: 76852
Buggy source:
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=retrieveMetaDataByQueryExecution(dataSetHandle);
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,false).executeQuery(query).getResultMetaData();
    addResultSetColumn(dataSetHandle,metaData);
    if (MetaDataPopulator.needsUseResultHint(dataSetHandle,metaData)) {
      metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,true).executeQuery(query).getResultMetaData();
    }
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}
Program: 76853
Project: 76853
Buggy source:
/** 
 * @param modelDataSet
 * @param dteDataSet
 */
private static void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if (!modelColumn.getColumnName().equals(modelColumn.getNativeName()))         dteDataSet.addResultSetHint(new ColumnAdapter((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(new ColumnAdapter(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(new ColumnAdapter(modelColumnHint));
    }
  }
}

Fixed version (ground truth):
/** 
 * @param modelDataSet
 * @param dteDataSet
 */
private static void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if ((!modelColumn.getColumnName().equals(modelColumn.getNativeName())) || modelColumn.getNativeDataType() == null)         dteDataSet.addResultSetHint(new ColumnAdapter((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(new ColumnAdapter(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(new ColumnAdapter(modelColumnHint));
    }
  }
}
Program: 76854
Project: 76854
Buggy source:
/** 
 */
private void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter=null;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if (!modelColumn.getColumnName().equals(modelColumn.getNativeName()))         dteDataSet.addResultSetHint(newColumnDefn((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(newColumnDefn(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(newColumnDefn(modelColumnHint));
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void mergeHints(DataSetHandle modelDataSet,BaseDataSetDesign dteDataSet){
  Iterator elmtIter=null;
  if (modelDataSet instanceof OdaDataSetHandle) {
    elmtIter=modelDataSet.resultSetIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        OdaResultSetColumnHandle modelColumn=(OdaResultSetColumnHandle)elmtIter.next();
        if ((!modelColumn.getColumnName().equals(modelColumn.getNativeName())) || modelColumn.getNativeDataType() == null)         dteDataSet.addResultSetHint(newColumnDefn((ResultSetColumnHandle)modelColumn));
      }
    }
  }
 else {
    elmtIter=modelDataSet.resultSetHintsIterator();
    if (elmtIter != null) {
      while (elmtIter.hasNext()) {
        ResultSetColumnHandle modelColumn=(ResultSetColumnHandle)elmtIter.next();
        dteDataSet.addResultSetHint(newColumnDefn(modelColumn));
      }
    }
  }
  elmtIter=modelDataSet.columnHintsIterator();
  if (elmtIter != null) {
    List columnDefns=dteDataSet.getResultSetHints();
    while (elmtIter.hasNext()) {
      ColumnHintHandle modelColumnHint=(ColumnHintHandle)elmtIter.next();
      ColumnDefinition existDefn=findColumnDefn(columnDefns,modelColumnHint.getColumnName());
      if (existDefn != null)       updateColumnDefn(existDefn,modelColumnHint);
 else       dteDataSet.addResultSetHint(newColumnDefn(modelColumnHint));
    }
  }
}
Program: 76855
Project: 76855
Buggy source:
/** 
 * Update column cache with clean the resultset property
 * @param dataSetHandle
 * @throws SemanticException
 */
public static void updateColumnCacheAfterCleanRs(DataSetHandle dataSetHandle) throws SemanticException {
  if (dataSetHandle instanceof OdaDataSetHandle)   dataSetHandle.getPropertyHandle(OdaDataSetHandle.RESULT_SET_PROP).clearValue();
  updateColumnCache(dataSetHandle);
}

Fixed version (ground truth):
/** 
 * Update column cache with clean the resultset property
 * @param dataSetHandle
 * @throws SemanticException
 */
public static void updateColumnCacheAfterCleanRs(DataSetHandle dataSetHandle) throws SemanticException {
  if (dataSetHandle instanceof OdaDataSetHandle) {
    Object obj=dataSetHandle.getElement().getLocalProperty(dataSetHandle.getModule(),OdaDataSetHandle.RESULT_SET_PROP);
    if (obj != null)     dataSetHandle.getPropertyHandle(OdaDataSetHandle.RESULT_SET_PROP).setValue(new ArrayList());
  }
  updateColumnCache(dataSetHandle);
}
Program: 76857
Project: 76857
Buggy source:
public Object[] next(){
  lRow++;
  if (lRow > lEndRow) {
    return null;
  }
  if (listMode) {
    oaTuple[0]=it.next();
  }
 else {
    final Object[] oaResultSet=(Object[])it.next();
    for (int i=0; i < iColumnCount; i++) {
      oaTuple[i]=oaResultSet[iaColumnIndexes[i]];
    }
  }
  return oaTuple;
}

Fixed version (ground truth):
public Object[] next(){
  lRow++;
  if (lRow > lEndRow) {
    return null;
  }
  if (listMode) {
    oaTuple[0]=it.next();
  }
 else {
    final Object[] oaResultSet=(Object[])it.next();
    for (int i=0; i < iColumnCount; i++) {
      if (iaColumnIndexes[i] != -1) {
        oaTuple[i]=oaResultSet[iaColumnIndexes[i]];
      }
    }
  }
  return oaTuple;
}
Program: 76858
Project: 76858
Buggy source:
/** 
 * Updates a strucutre list with the corresponding property handle.
 * @param propHandle the property handle
 * @param structList the structure list
 * @throws SemanticException if any strucutre has invalid value.
 */
private void updateROMResultSets(OdaDataSetHandle setHandle,List structList) throws SemanticException {
  List columns=new ArrayList();
  List hints=new ArrayList();
  ResultSetColumnInfo.updateResultSetColumnList(structList,columns,hints);
  PropertyHandle propHandle=setHandle.getPropertyHandle(OdaDataSetHandle.RESULT_SET_PROP);
  propHandle.setValue(null);
  if (!columns.isEmpty()) {
    for (int i=0; i < columns.size(); i++)     propHandle.addItem(columns.get(i));
  }
  propHandle=setHandle.getPropertyHandle(OdaDataSetHandle.COLUMN_HINTS_PROP);
  if (!hints.isEmpty()) {
    for (int i=0; i < hints.size(); i++) {
      ColumnHint hint=(ColumnHint)hints.get(i);
      ColumnHintHandle oldHint=ResultSetsAdapter.findColumnHint((String)hint.getProperty(null,ColumnHint.COLUMN_NAME_MEMBER),setHandle.columnHintsIterator());
      if (oldHint == null)       propHandle.addItem(hints.get(i));
 else {
        oldHint.setDisplayName((String)hint.getProperty(null,ColumnHint.DISPLAY_NAME_MEMBER));
        oldHint.setHelpText((String)hint.getProperty(null,ColumnHint.HELP_TEXT_MEMBER));
        oldHint.setFormat((String)hint.getProperty(null,ColumnHint.FORMAT_MEMBER));
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates a strucutre list with the corresponding property handle.
 * @param propHandle the property handle
 * @param structList the structure list
 * @throws SemanticException if any strucutre has invalid value.
 */
private void updateROMResultSets(OdaDataSetHandle setHandle,List structList) throws SemanticException {
  List columns=new ArrayList();
  List hints=new ArrayList();
  ResultSetColumnInfo.updateResultSetColumnList(structList,columns,hints);
  PropertyHandle propHandle=setHandle.getPropertyHandle(OdaDataSetHandle.RESULT_SET_PROP);
  propHandle.setValue(new ArrayList());
  if (!columns.isEmpty()) {
    for (int i=0; i < columns.size(); i++)     propHandle.addItem(columns.get(i));
  }
  propHandle=setHandle.getPropertyHandle(OdaDataSetHandle.COLUMN_HINTS_PROP);
  propHandle.setValue(new ArrayList());
  if (!hints.isEmpty()) {
    for (int i=0; i < hints.size(); i++) {
      ColumnHint hint=(ColumnHint)hints.get(i);
      ColumnHintHandle oldHint=ResultSetsAdapter.findColumnHint((String)hint.getProperty(null,ColumnHint.COLUMN_NAME_MEMBER),setHandle.columnHintsIterator());
      if (oldHint == null)       propHandle.addItem(hints.get(i));
 else {
        oldHint.setDisplayName((String)hint.getProperty(null,ColumnHint.DISPLAY_NAME_MEMBER));
        oldHint.setHelpText((String)hint.getProperty(null,ColumnHint.HELP_TEXT_MEMBER));
        oldHint.setFormat((String)hint.getProperty(null,ColumnHint.FORMAT_MEMBER));
      }
    }
  }
}
Program: 76861
Project: 76861
Buggy source:
public boolean layout(){
  boolean childBreak=super.layout();
  if (childBreak) {
    IPDFTableLayoutManager itsTableLM=getTableLayoutManager();
    if (itsTableLM != null) {
      if (!isFinished() && needPageBreakBefore(null)) {
        itsTableLM.setTableCloseStateAsForced();
      }
 else       if (isFinished() && needPageBreakAfter(null)) {
        itsTableLM.setTableCloseStateAsForced();
      }
    }
  }
  return childBreak;
}

Fixed version (ground truth):
public boolean layout(){
  boolean childBreak=super.layout();
  if (childBreak) {
    IPDFTableLayoutManager itsTableLM=getTableLayoutManager();
    if (itsTableLM != null) {
      IStyle cStyle=content.getStyle();
      if (!isFinished() && needPageBreakBefore(cStyle.getPageBreakBefore())) {
        itsTableLM.setTableCloseStateAsForced();
      }
 else       if (isFinished() && needPageBreakAfter(cStyle.getPageBreakAfter())) {
        itsTableLM.setTableCloseStateAsForced();
      }
    }
  }
  return childBreak;
}
Program: 76862
Project: 76862
Buggy source:
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName(dataSetHandle.getQualifiedName());
  query.setMaxRows(1);
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,false).executeQuery(query).getResultMetaData();
    addResultSetColumn(dataSetHandle,metaData);
    if (MetaDataPopulator.needsUseResultHint(dataSetHandle,metaData)) {
      metaData=new QueryExecutionHelper(dataEngine,modelAdaptor,sessionContext,true).executeQuery(query).getResultMetaData();
    }
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}

Fixed version (ground truth):
/** 
 * @param dataSetName
 * @return
 * @throws BirtException
 */
private IResultMetaData getRealMetaData(DataSetHandle dataSetHandle) throws BirtException {
  IResultMetaData metaData=MetaDataPopulator.retrieveResultMetaData(dataSetHandle);
  if (metaData == null) {
    metaData=retrieveMetaDataByQueryExecution(dataSetHandle);
  }
  if (!(dataSetHandle instanceof ScriptDataSetHandle))   clearUnusedData(dataSetHandle,metaData);
  return metaData;
}
Program: 76863
Project: 76863
Buggy source:
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i - 1);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompatibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}

Fixed version (ground truth):
/** 
 * @param meta
 * @throws BirtException
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i - 1);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(toModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompatibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}
Program: 76864
Project: 76864
Buggy source:
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    rsMeta=this.getDataSetMetaData(dataSetHandle,false);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    List columnList=new ArrayList();
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        columnList.add(rsc);
      }
    }
    if (holdEvent || !dataSetHandle.canEdit()) {
      CompatibilityUtil.updateResultSetinCachedMetaData(dataSetHandle,columnList);
    }
 else {
      dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
      for (int i=0; i < columnList.size(); i++) {
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem((ResultSetColumn)columnList.get(i));
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}

Fixed version (ground truth):
/** 
 * @param dataSetHandle
 * @return
 * @throws BirtException
 */
IResultMetaData refreshMetaData(DataSetHandle dataSetHandle,boolean holdEvent) throws BirtException {
  IResultMetaData rsMeta=null;
  BirtException e=null;
  try {
    if (dataSetHandle == null) {
      throw new AdapterException(ResourceConstants.DATASETHANDLE_NULL_ERROR);
    }
    rsMeta=this.retrieveMetaDataByQueryExecution(dataSetHandle);
    if (!(dataSetHandle instanceof ScriptDataSetHandle))     clearUnusedData(dataSetHandle,rsMeta);
  }
 catch (  BirtException e1) {
    e=e1;
  }
  if (needsSetCachedMetaData(dataSetHandle,rsMeta)) {
    List columnList=new ArrayList();
    if (rsMeta != null && rsMeta.getColumnCount() != 0) {
      for (int i=1; i <= rsMeta.getColumnCount(); i++) {
        ResultSetColumn rsc=StructureFactory.createResultSetColumn();
        rsc.setColumnName(getColumnName(rsMeta,i));
        rsc.setDataType(toModelDataType(rsMeta.getColumnType(i)));
        rsc.setPosition(new Integer(i));
        columnList.add(rsc);
      }
    }
    if (holdEvent || !dataSetHandle.canEdit()) {
      CompatibilityUtil.updateResultSetinCachedMetaData(dataSetHandle,columnList);
    }
 else {
      dataSetHandle.setCachedMetaData(StructureFactory.createCachedMetaData());
      for (int i=0; i < columnList.size(); i++) {
        dataSetHandle.getCachedMetaDataHandle().getResultSet().addItem((ResultSetColumn)columnList.get(i));
      }
    }
  }
  if (e != null)   throw e;
  return rsMeta;
}
Program: 76865
Project: 76865
Buggy source:
/** 
 * @return
 */
public String getNamespace(){
  return object.getNamespace();
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getNamespace(){
  return object.getContributor().getName();
}
Program: 76866
Project: 76866
Buggy source:
/** 
 * @return
 */
public String getNamespace(){
  return object.getNamespace();
}

Fixed version (ground truth):
/** 
 * @return
 */
public String getNamespace(){
  return object.getContributor().getName();
}
Program: 76868
Project: 76868
Buggy source:
public String format(Date date){
  StringBuffer str=new StringBuffer();
  FieldPosition pos=new FieldPosition(DateFormat.DATE_FIELD);
  DateFormat df=DateFormat.getDateInstance(DateFormat.LONG,locale);
  df.format(date,str,pos);
  int endIndex=pos.getEndIndex() + (str.charAt(pos.getEndIndex()) == ',' ? 2 : 1);
  if (endIndex >= str.length()) {
    return str.substring(0,pos.getBeginIndex());
  }
  return str.substring(0,pos.getBeginIndex()) + str.substring(endIndex);
}

Fixed version (ground truth):
public String format(Date date){
  StringBuffer str=new StringBuffer();
  FieldPosition pos=new FieldPosition(DateFormat.DATE_FIELD);
  DateFormat df=DateFormat.getDateInstance(DateFormat.LONG,locale);
  df.format(date,str,pos);
  int endIndex;
  if (pos.getEndIndex() >= str.length()) {
    endIndex=pos.getEndIndex();
  }
 else {
    endIndex=pos.getEndIndex() + (str.charAt(pos.getEndIndex()) == ',' ? 2 : 1);
  }
  if (endIndex >= str.length()) {
    return str.substring(0,pos.getBeginIndex()).trim();
  }
  return str.substring(0,pos.getBeginIndex()) + str.substring(endIndex);
}
Program: 76871
Project: 76871
Buggy source:
public String getAttributeAsIs(String name){
  return object.getAttributeAsIs(name);
}

Fixed version (ground truth):
/** 
 * @deprecated The method is equivalent to the {@link #getAttribute(String)}. Contrary to its description, this method returns a translated value. Use the   {@link #getAttribute(String)} method instead.
 */
public String getAttributeAsIs(String name){
  return object.getAttributeAsIs(name);
}
Program: 76872
Project: 76872
Buggy source:
public String getValueAsIs(){
  return object.getValueAsIs();
}

Fixed version (ground truth):
/** 
 * @deprecated The method is equivalent to the {@link #getValue()}. Contrary to its description, this method returns a translated value. Use the   {@link #getValue()} method instead.
 */
public String getValueAsIs(){
  return object.getValueAsIs();
}
Program: 76873
Project: 76873
Buggy source:
public URL asLocalURL(URL url) throws IOException {
  return Platform.asLocalURL(url);
}

Fixed version (ground truth):
public URL asLocalURL(URL url) throws IOException {
  return FileLocator.toFileURL(url);
}
Program: 76874
Project: 76874
Buggy source:
public URL find(IBundle bundle,IPlatformPath path){
  if ((bundle instanceof EclipseBundle) && (path instanceof EclipsePath)) {
    return Platform.find(((EclipseBundle)bundle).bundle,((EclipsePath)path).path);
  }
  return null;
}

Fixed version (ground truth):
public URL find(IBundle bundle,IPlatformPath path){
  if ((bundle instanceof EclipseBundle) && (path instanceof EclipsePath)) {
    return FileLocator.find(((EclipseBundle)bundle).bundle,((EclipsePath)path).path,null);
  }
  return null;
}
Program: 76877
Project: 76877
Buggy source:
private final int jjMoveNfa_1(int startState,int curPos){
  int[] nextStates;
  int startsAt=0;
  jjnewStateCnt=3;
  int i=1;
  jjstateSet[0]=startState;
  int j, kind=0x7fffffff;
  for (; ; ) {
    if (++jjround == 0x7fffffff)     ReInitRounds();
    if (curChar < 64) {
      long l=1L << curChar;
      MatchLoop:       do {
switch (jjstateSet[--i]) {
case 0:
          if ((0x100002600L & l) != 0L) {
            if (kind > 8)             kind=8;
          }
 else           if ((0x600000000000L & l) != 0L) {
            if (kind > 16)             kind=16;
            jjCheckNAdd(2);
          }
        break;
case 1:
      if ((0x600000000000L & l) == 0L)       break;
    if (kind > 16)     kind=16;
  jjCheckNAdd(2);
break;
case 2:
if ((0x3ff600000000000L & l) == 0L) break;
if (kind > 16) kind=16;
jjCheckNAdd(2);
break;
default :
break;
}
}
 while (i != startsAt);
}
 else if (curChar < 128) {
long l=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
case 0:
case 2:
if ((0x7fffffe87fffffeL & l) == 0L) break;
if (kind > 16) kind=16;
jjCheckNAdd(2);
break;
default :
break;
}
}
 while (i != startsAt);
}
 else {
int hiByte=(int)(curChar >> 8);
int i1=hiByte >> 6;
long l1=1L << (hiByte & 077);
int i2=(curChar & 0xff) >> 6;
long l2=1L << (curChar & 077);
MatchLoop: do {
switch (jjstateSet[--i]) {
default :
break;
}
}
 while (i != startsAt);
}
if (kind != 0x7fffffff) {
jjmatchedKind=kind;
jjmatchedPos=curPos;
kind=0x7fffffff;
}
++curPos;
if ((i=jjnewStateCnt) == (startsAt=3 - (jjnewStateCnt=startsAt))) return curPos;
try {
curChar=input_stream.readChar();
}
 catch (java.io.IOException e) {
return curPos;
}
}
}

Fixed version (ground truth):
private final int jjMoveNfa_1(int startState,int curPos){
  int startsAt=0;
  jjnewStateCnt=3;
  int i=1;
  jjstateSet[0]=startState;
  int kind=0x7fffffff;
  for (; ; ) {
    if (++jjround == 0x7fffffff)     ReInitRounds();
    if (curChar < 64) {
      long l=1L << curChar;
      do {
switch (jjstateSet[--i]) {
case 0:
          if ((0x100002600L & l) != 0L) {
            if (kind > 8)             kind=8;
          }
 else           if ((0x600000000000L & l) != 0L) {
            if (kind > 16)             kind=16;
            jjCheckNAdd(2);
          }
        break;
case 1:
      if ((0x600000000000L & l) == 0L)       break;
    if (kind > 16)     kind=16;
  jjCheckNAdd(2);
break;
case 2:
if ((0x3ff600000000000L & l) == 0L) break;
if (kind > 16) kind=16;
jjCheckNAdd(2);
break;
default :
break;
}
}
 while (i != startsAt);
}
 else if (curChar < 128) {
long l=1L << (curChar & 077);
do {
switch (jjstateSet[--i]) {
case 0:
case 2:
if ((0x7fffffe87fffffeL & l) == 0L) break;
if (kind > 16) kind=16;
jjCheckNAdd(2);
break;
default :
break;
}
}
 while (i != startsAt);
}
 else {
do {
switch (jjstateSet[--i]) {
default :
break;
}
}
 while (i != startsAt);
}
if (kind != 0x7fffffff) {
jjmatchedKind=kind;
jjmatchedPos=curPos;
kind=0x7fffffff;
}
++curPos;
if ((i=jjnewStateCnt) == (startsAt=3 - (jjnewStateCnt=startsAt))) return curPos;
try {
curChar=input_stream.readChar();
}
 catch (java.io.IOException e) {
return curPos;
}
}
}