nus-yam/ex-repair huggingface dataset:
Program: 71690
Project: 71690
Buggy source:
public IQueryResults executeQuery(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws BirtException {
  setModuleHandleToAppContext();
  return new QueryExecutionHelper(this.dataEngine,this.modelAdaptor,this.sessionContext).executeQuery(queryDefn,paramBindingIt,filterIt,bindingIt,this.sessionContext.getTopScope());
}

Fixed version (ground truth):
public IQueryResults executeQuery(IQueryDefinition queryDefn,Iterator paramBindingIt,Iterator filterIt,Iterator bindingIt) throws BirtException {
  return new QueryExecutionHelper(this.dataEngine,this.modelAdaptor,this.sessionContext).executeQuery(queryDefn,paramBindingIt,filterIt,bindingIt,this.sessionContext.getTopScope());
}
Program: 71693
Project: 71693
Buggy source:
public List getUnresolvedRowHints(){
  return hints;
}

Fixed version (ground truth):
public List<UnresolvedRowHint> getUnresolvedRowHints(){
  return pageRowHints;
}
Program: 71694
Project: 71694
Buggy source:
public UnresolvedRowHint getUnresolvedRowHint(ITableContent table){
  if (hints.size() > 0) {
    String idStr=table.getInstanceID().toUniqueString();
    Iterator iter=hints.iterator();
    while (iter.hasNext()) {
      UnresolvedRowHint rowHint=(UnresolvedRowHint)iter.next();
      if (idStr.equals(rowHint.getTableId())) {
        return rowHint;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public UnresolvedRowHint getUnresolvedRowHint(String key){
  if (hints.size() > 0) {
    return hints.get(key);
  }
  return null;
}
Program: 71695
Project: 71695
Buggy source:
public void setLayoutPageHint(IPageHint pageHint){
  if (pageHint != null) {
    pageNumber=pageHint.getPageNumber();
    masterPage=pageHint.getMasterPage();
    int count=pageHint.getUnresolvedRowCount();
    for (int i=0; i < count; i++) {
      hints.add(pageHint.getUnresolvedRowHint(i));
    }
    count=pageHint.getTableColumnHintCount();
    for (int i=0; i < count; i++) {
      columnHints.add(pageHint.getTableColumnHint(i));
    }
  }
}

Fixed version (ground truth):
public void setLayoutPageHint(IPageHint pageHint){
  if (pageHint != null) {
    pageNumber=pageHint.getPageNumber();
    masterPage=pageHint.getMasterPage();
    int count=pageHint.getTableColumnHintCount();
    for (int i=0; i < count; i++) {
      columnHints.add(pageHint.getTableColumnHint(i));
    }
    count=pageHint.getUnresolvedRowCount();
    if (count > 0) {
      for (int i=0; i < count; i++) {
        UnresolvedRowHint hint=pageHint.getUnresolvedRowHint(i);
        String key=getHintMapKey(hint.getTableId());
        hints.put(key,hint);
      }
    }
  }
}
Program: 71696
Project: 71696
Buggy source:
public void clearPageHint(){
  columnHints.clear();
  pageHints.clear();
  hints.clear();
  hints.addAll(currentHints);
  currentHints.clear();
}

Fixed version (ground truth):
public void clearPageHint(){
  columnHints.clear();
  pageHints.clear();
}
Program: 71697
Project: 71697
Buggy source:
public void addUnresolvedRowHint(UnresolvedRowHint hint){
  currentHints.add(hint);
}

Fixed version (ground truth):
public void addUnresolvedRowHint(String key,UnresolvedRowHint hint){
  currentHints.put(key,hint);
}
Program: 71698
Project: 71698
Buggy source:
protected void end(boolean finished){
  if (emitter != null) {
    context.getPageBufferManager().endContainer(pageContent,finished,emitter,true);
    context.getBufferFactory().close();
  }
}

Fixed version (ground truth):
protected void end(boolean finished){
  if (emitter != null) {
    context.getPageBufferManager().endContainer(pageContent,finished,emitter,true);
    context.getBufferFactory().close();
  }
  context.resetRowHint();
}
Program: 71699
Project: 71699
Buggy source:
public boolean layout(){
  if (context.getCancelFlag()) {
    close();
    isLastPage=true;
    return false;
  }
  start(isFirstPage);
  boolean hasNextPage=layoutNodes();
  if (isChildrenFinished()) {
    isLastPage=true;
  }
  if (hasNextPage && !isLastPage) {
    context.addLayoutHint(pageContent,false);
  }
  isFirstPage=false;
  end(isLastPage);
  context.initilizePage();
  return hasNextPage;
}

Fixed version (ground truth):
public boolean layout(){
  if (context.getCancelFlag()) {
    close();
    isLastPage=true;
    return false;
  }
  start(isFirstPage);
  boolean hasNextPage=layoutNodes();
  if (isChildrenFinished()) {
    isLastPage=true;
  }
  if (hasNextPage && !isLastPage) {
    context.addLayoutHint(pageContent,false);
  }
 else {
    context.removeLayoutHint(pageContent);
  }
  isFirstPage=false;
  end(isLastPage);
  context.initilizePage();
  return hasNextPage;
}
Program: 71700
Project: 71700
Buggy source:
protected boolean layoutChildren(){
  boolean hasNext=layoutNodes();
  if (hasNext) {
    context.addLayoutHint(content,false);
  }
  return hasNext;
}

Fixed version (ground truth):
protected boolean layoutChildren(){
  boolean hasNext=layoutNodes();
  if (hasNext) {
    context.addLayoutHint(content,false);
  }
 else {
    context.removeLayoutHint(content);
  }
  return hasNext;
}
Program: 71701
Project: 71701
Buggy source:
protected boolean layoutChildren(){
  boolean hasNext=super.layoutChildren();
  if (hasNext) {
    context.addLayoutHint(content,!hasNext);
  }
  if (!hasNext) {
  }
  return hasNext;
}

Fixed version (ground truth):
protected boolean layoutChildren(){
  boolean hasNext=super.layoutChildren();
  if (!hasNext) {
  }
  return hasNext;
}
Program: 71702
Project: 71702
Buggy source:
public void startTable(ITableContent table){
  nestTableCount++;
  if (cellEmitter != null) {
    cellEmitter.startTable(table);
  }
 else {
    if (!isNestTable()) {
      initLayout(table);
      if (isFirst) {
        if (context != null) {
          hint=context.getUnresolvedRowHint(table);
          isFirst=false;
        }
      }
      layout.setUnresolvedRowHint(hint);
      emitter.startTable(layout.getWrappedTableContent());
    }
 else {
      emitter.startTable(table);
    }
  }
}

Fixed version (ground truth):
public void startTable(ITableContent table){
  nestTableCount++;
  if (cellEmitter != null) {
    cellEmitter.startTable(table);
  }
 else {
    if (!isNestTable()) {
      UnresolvedRowHint hint=null;
      initLayout(table);
      emitter.startTable(layout.getWrappedTableContent());
      this.lastRowId=-1;
    }
 else {
      emitter.startTable(table);
    }
  }
}
Program: 71703
Project: 71703
Buggy source:
public void startRow(IRowContent row){
  if (cellEmitter != null) {
    cellEmitter.startRow(row);
  }
 else {
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (!isNestTable()) {
      layout.createRow(row,isHidden);
      if (!isHidden) {
        if (hasDropCell()) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          return;
        }
 else         if (layout.hasUnResolvedRow() && !LayoutUtil.isRepeatableRow(row)) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          hasDropCell=true;
          return;
        }
      }
    }
    if (!isHidden) {
      emitter.startRow(row);
    }
  }
}

Fixed version (ground truth):
public void startRow(IRowContent row){
  if (cellEmitter != null) {
    cellEmitter.startRow(row);
  }
 else {
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (!LayoutUtil.isRepeatableRow(row)) {
      int rowId=row.getRowID();
      if (lastRowId >= 0 && rowId > lastRowId - 1) {
        for (int i=lastRowId + 1; i < rowId; i++) {
          IRowContent newRow=(IRowContent)row.cloneContent(false);
          newRow.setParent(row.getParent());
          newRow.setRowID(i);
          startRow(newRow);
          endRow(newRow);
        }
      }
    }
    if (!isNestTable()) {
      layout.createRow(row,isHidden);
      if (!isHidden) {
        if (hasDropCell()) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          return;
        }
 else         if (layout.hasUnResolvedRow() && !LayoutUtil.isRepeatableRow(row)) {
          layoutEvents.push(new LayoutEvent(LayoutEvent.ON_ROW,new StartInfo(layout.getRowCount() - 1,0)));
          hasDropCell=true;
          return;
        }
      }
    }
    if (!isHidden) {
      emitter.startRow(row);
    }
  }
}
Program: 71704
Project: 71704
Buggy source:
public void endRow(IRowContent row){
  if (cellEmitter != null) {
    cellEmitter.endRow(row);
  }
 else {
    if (!isNestTable()) {
      layout.endRow(row);
      hasDropCell=layout.hasDropCell();
      if (hasDropCell()) {
        return;
      }
      if (layoutEvents.size() > 0) {
        flush();
        return;
      }
    }
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (!isHidden) {
      emitter.endRow(row);
    }
  }
}

Fixed version (ground truth):
public void endRow(IRowContent row){
  if (cellEmitter != null) {
    cellEmitter.endRow(row);
  }
 else {
    if (!isNestTable()) {
      layout.endRow(row);
      if (!LayoutUtil.isRepeatableRow(row)) {
        lastRowId=row.getRowID();
      }
      hasDropCell=layout.hasDropCell();
      if (hasDropCell()) {
        return;
      }
      if (layoutEvents.size() > 0) {
        flush();
        return;
      }
    }
    boolean isHidden=LayoutUtil.isHidden(row,emitter.getOutputFormat(),context.getOutputDisplayNone());
    if (!isHidden) {
      emitter.endRow(row);
    }
  }
}
Program: 71705
Project: 71705
Buggy source:
public void initLayout(ITableContent table){
  this.layout=new TableContentLayout(table,getOutputFormat(),context);
  this.layoutEvents=new Stack();
}

Fixed version (ground truth):
public void initLayout(ITableContent table){
  String keyString=context.getHintMapKey(table.getInstanceID().toUniqueString());
  this.layout=new TableContentLayout(table,getOutputFormat(),context,keyString);
  this.layoutEvents=new Stack();
  UnresolvedRowHint hint=null;
  if (isFirst) {
    if (context != null) {
      hint=context.getUnresolvedRowHint(keyString);
      isFirst=false;
    }
  }
  if (hint == null) {
    hint=hintMap.get(keyString);
  }
  layout.setUnresolvedRowHint(hint);
}
Program: 71706
Project: 71706
Buggy source:
public void resolveAll(boolean finished){
  layout.resolveDropCells(finished);
  hint=layout.getUnresolvedRow();
  if (context != null && hint != null) {
    context.addUnresolvedRowHint(hint);
  }
  hasDropCell=layout.hasDropCell();
}

Fixed version (ground truth):
public void resolveAll(boolean finished){
  layout.resolveDropCells(finished);
  UnresolvedRowHint hint=layout.getUnresolvedRow();
  if (hint != null) {
    hintMap.put(layout.getKeyString(),hint);
    if (context != null) {
      context.addUnresolvedRowHint(layout.getKeyString(),hint);
    }
  }
  hasDropCell=layout.hasDropCell();
}
Program: 71707
Project: 71707
Buggy source:
public void flush(){
  if (page != null) {
    context.addTableColumnHints(columnHints);
    page.flush();
    pageBreakEvent();
    if (!page.finished) {
      context.setPageNumber(context.getPageNumber() + 1);
      context.setPageCount(context.getPageCount() + 1);
    }
    generator.reset();
    context.removeLayoutHint();
    context.clearPageHint();
    currentNode=null;
  }
}

Fixed version (ground truth):
public void flush(){
  if (page != null) {
    context.addTableColumnHints(columnHints);
    context.generatePageRowHints(getTableKeys());
    page.flush();
    pageBreakEvent();
    if (!page.finished) {
      context.setPageNumber(context.getPageNumber() + 1);
      context.setPageCount(context.getPageCount() + 1);
    }
    generator.reset();
    context.clearPageHint();
    currentNode=null;
  }
}
Program: 71708
Project: 71708
Buggy source:
public Data(final Object txt,final StyleEntry s,final String datatype,XlsContainer container){
  this.txt=txt;
  this.style=s;
  this.datatype=datatype;
  id=ID++;
  this.container=container;
}

Fixed version (ground truth):
public Data(final Object txt,final StyleEntry s,final String datatype,XlsContainer container,int rowSpanOfDesign){
  this.txt=txt;
  this.style=s;
  this.datatype=datatype;
  id=ID++;
  this.container=container;
  this.rowSpanInDesign=0;
}
Program: 71709
Project: 71709
Buggy source:
public void startCell(ICellContent cell){
  IStyle style=cell.getComputedStyle();
  engine.addCell(cell.getColumn(),cell.getColSpan(),style);
}

Fixed version (ground truth):
public void startCell(ICellContent cell){
  IStyle style=cell.getComputedStyle();
  engine.addCell(cell.getColumn(),cell.getColSpan(),cell.getRowSpan(),style);
}
Program: 71710
Project: 71710
Buggy source:
public void startListBand(IListBandContent listBand){
  engine.addCell(0,1,listBand.getComputedStyle());
}

Fixed version (ground truth):
public void startListBand(IListBandContent listBand){
  engine.addCell(0,1,0,listBand.getComputedStyle());
}
Program: 71711
Project: 71711
Buggy source:
private void applyContainerTopBorder(ContainerSizeInfo rule,int pos){
  if (engine.getContainers().size() == 0) {
    return;
  }
  XlsContainer container=engine.getCurrentContainer();
  StyleEntry entry=container.getStyle();
  int col=engine.getAxis().getColumnIndexByCoordinate(rule.getStartCoordinate());
  int span=engine.getAxis().getColumnIndexByCoordinate(rule.getEndCoordinate()) - col;
  for (int i=col; i < span + col; i++) {
    Data data=engine.getData(i,pos);
    if (data == null || data == Data.WASTE) {
      continue;
    }
    StyleBuilder.applyTopBorder(entry,data.style);
  }
}

Fixed version (ground truth):
private void applyContainerTopBorder(ContainerSizeInfo rule,int pos){
  if (engine.getContainers().size() == 0) {
    return;
  }
  XlsContainer container=engine.getCurrentContainer();
  StyleEntry entry=container.getStyle();
  int col=engine.getAxis().getColumnIndexByCoordinate(rule.getStartCoordinate());
  int span=engine.getAxis().getColumnIndexByCoordinate(rule.getEndCoordinate()) - col;
  for (int i=col; i < span + col; i++) {
    Data data=engine.getData(i,pos);
    if (data == null || data.isBlank()) {
      continue;
    }
    StyleBuilder.applyTopBorder(entry,data.style);
  }
}
Program: 71712
Project: 71712
Buggy source:
public Data getData(int col,int row){
  Object object=cache.getData(col,row);
  return object == Data.WASTE ? null : (Data)object;
}

Fixed version (ground truth):
public Data getData(int col,int row){
  Object object=cache.getData(col,row);
  Data data=(Data)object;
  if (data == null || data.isBlank()) {
    return null;
  }
  return data;
}
Program: 71713
Project: 71713
Buggy source:
private void synchronize(){
  XlsContainer rowContainer=getCurrentContainer();
  ContainerSizeInfo rowSizeInfo=rowContainer.getSizeInfo();
  int startCoordinate=rowSizeInfo.getStartCoordinate();
  int endCoordinate=rowSizeInfo.getEndCoordinate();
  int startColumnIndex=axis.getColumnIndexByCoordinate(startCoordinate);
  int endColumnIndex=axis.getColumnIndexByCoordinate(endCoordinate);
  int max=0;
  int len[]=new int[endColumnIndex - startColumnIndex];
  for (int i=startColumnIndex; i < endColumnIndex; i++) {
    int columnsize=cache.getStartRowId(i);
    len[i - startColumnIndex]=columnsize;
    max=max > columnsize ? max : columnsize;
  }
  for (int i=startColumnIndex; i < endColumnIndex; i++) {
    int rowspan=max - len[i - startColumnIndex];
    int last=len[i - startColumnIndex] - 1;
    if (rowspan > 0) {
      Data data=null;
      Data upstair=cache.getData(i,last);
      if (upstair != null && upstair != Data.WASTE && isInContainer(upstair,rowContainer)) {
        Data predata=upstair;
        int rs=predata.getRowSpan() + rowspan;
        predata.setRowSpan(rs);
        data=predata;
      }
 else {
        data=Data.WASTE;
      }
      for (int p=0; p < rowspan; p++) {
        cache.addData(i,Data.WASTE);
      }
    }
  }
}

Fixed version (ground truth):
private void synchronize(){
  XlsContainer rowContainer=getCurrentContainer();
  ContainerSizeInfo rowSizeInfo=rowContainer.getSizeInfo();
  int startCoordinate=rowSizeInfo.getStartCoordinate();
  int endCoordinate=rowSizeInfo.getEndCoordinate();
  int startColumnIndex=axis.getColumnIndexByCoordinate(startCoordinate);
  int endColumnIndex=axis.getColumnIndexByCoordinate(endCoordinate);
  int max=0;
  int len[]=new int[endColumnIndex - startColumnIndex];
  for (int i=startColumnIndex; i < endColumnIndex; i++) {
    int columnsize=cache.getStartRowId(i);
    len[i - startColumnIndex]=columnsize;
    max=max > columnsize ? max : columnsize;
  }
  for (int i=startColumnIndex; i < endColumnIndex; i++) {
    int rowspan=max - len[i - startColumnIndex];
    int last=len[i - startColumnIndex] - 1;
    if (rowspan > 0) {
      Data data=null;
      Data upstair=cache.getData(i,last);
      if (upstair != null && canSpan(upstair,rowContainer)) {
        Data predata=upstair;
        int rs=predata.getRowSpan() + rowspan;
        predata.setRowSpan(rs);
        BlankData blankData=new BlankData(getRealData(predata));
        if (!isInContainer(predata,rowContainer)) {
          blankData.decreasRowSpanInDesign();
        }
        data=blankData;
      }
 else {
        data=new BlankData(null);
      }
      for (int p=0; p < rowspan; p++) {
        cache.addData(i,data);
      }
    }
  }
}
Program: 71714
Project: 71714
Buggy source:
public void addCell(int col,int span,IStyle style){
  XlsTable table=tables.peek();
  ContainerSizeInfo cellSizeInfo=table.getColumnSizeInfo(col,span);
  addContainer(createContainer(cellSizeInfo,style,getCurrentContainer()));
}

Fixed version (ground truth):
public void addCell(int col,int colSpan,int rowSpan,IStyle style){
  XlsTable table=tables.peek();
  ContainerSizeInfo cellSizeInfo=table.getColumnSizeInfo(col,colSpan);
  addContainer(createCellContainer(cellSizeInfo,style,getCurrentContainer(),rowSpan));
}
Program: 71715
Project: 71715
Buggy source:
private void addData(Data data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getRule().getStartCoordinate());
  int span=axis.getColumnIndexByCoordinate(data.getRule().getEndCoordinate()) - col;
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    addDatatoCache(i,Data.WASTE);
  }
}

Fixed version (ground truth):
private void addData(Data data){
  XlsContainer container=getCurrentContainer();
  container.setEmpty(false);
  int col=axis.getColumnIndexByCoordinate(data.getRule().getStartCoordinate());
  int span=axis.getColumnIndexByCoordinate(data.getRule().getEndCoordinate()) - col;
  addDatatoCache(col,data);
  for (int i=col + 1; i < col + span; i++) {
    addDatatoCache(i,BlankData.BLANK);
  }
  if (container instanceof XlsCell) {
    XlsCell cell=(XlsCell)container;
    data.setRowSpanInDesign(cell.getRowSpan() - 1);
  }
}
Program: 71716
Project: 71716
Buggy source:
public Data[] getRow(int rownum){
  Data[] row=cache.getRowData(rownum);
  List<Data> data=new ArrayList<Data>();
  int width=Math.min(row.length,MAX_COLUMN - 1);
  for (int i=0; i < width; i++) {
    if (Data.WASTE == row[i]) {
      continue;
    }
    Data d=(Data)row[i];
    if (d.isProcessed()) {
      continue;
    }
    d.setProcessed(true);
    data.add(row[i]);
  }
  Data[] rowdata=new Data[data.size()];
  data.toArray(rowdata);
  return rowdata;
}

Fixed version (ground truth):
public Data[] getRow(int rownum){
  Data[] row=cache.getRowData(rownum);
  List<Data> data=new ArrayList<Data>();
  int width=Math.min(row.length,MAX_COLUMN - 1);
  for (int i=0; i < width; i++) {
    Data d=(Data)row[i];
    if (d.isBlank()) {
      continue;
    }
    if (d.isProcessed()) {
      continue;
    }
    d.setProcessed(true);
    data.add(row[i]);
  }
  Data[] rowdata=new Data[data.size()];
  data.toArray(rowdata);
  return rowdata;
}
Program: 71717
Project: 71717
Buggy source:
public void complete(){
  int rowcount=cache.getMaxRow();
  for (int i=0; i < rowcount; i++) {
    Object[] row=cache.getRowData(i);
    for (int j=0; j < row.length; j++) {
      if (row[j] == Data.WASTE) {
        continue;
      }
      Data d=(Data)row[j];
      int styleid=engine.getStyleID(d.getStyleEntry());
      d.setStyleId(styleid);
      ContainerSizeInfo rule=d.getRule();
      int start=axis.getColumnIndexByCoordinate(rule.getStartCoordinate()) + 1;
      int end=axis.getColumnIndexByCoordinate(rule.getEndCoordinate()) + 1;
      end=Math.min(end,MAX_COLUMN);
      int scount=Math.max(0,end - start - 1);
      Span span=new Span(start,scount);
      HyperlinkDef link=d.getHyperlinkDef();
      if (link != null && link.getBookmark() != null) {
        links.put(link.getBookmark(),getCellName(i + 1,start + 1));
      }
      d.setSpan(span);
    }
  }
}

Fixed version (ground truth):
public void complete(){
  int rowcount=cache.getMaxRow();
  for (int i=0; i < rowcount; i++) {
    Object[] row=cache.getRowData(i);
    for (int j=0; j < row.length; j++) {
      Data d=(Data)row[j];
      if (d.isBlank()) {
        continue;
      }
      int styleid=engine.getStyleID(d.getStyleEntry());
      d.setStyleId(styleid);
      ContainerSizeInfo rule=d.getRule();
      int start=axis.getColumnIndexByCoordinate(rule.getStartCoordinate()) + 1;
      int end=axis.getColumnIndexByCoordinate(rule.getEndCoordinate()) + 1;
      end=Math.min(end,MAX_COLUMN);
      int scount=Math.max(0,end - start - 1);
      Span span=new Span(start,scount);
      HyperlinkDef link=d.getHyperlinkDef();
      if (link != null && link.getBookmark() != null) {
        links.put(link.getBookmark(),getCellName(i + 1,start + 1));
      }
      d.setSpan(span);
    }
  }
}
Program: 71719
Project: 71719
Buggy source:
protected DimensionType createDimension(DimensionHandle handle,boolean useDefault){
  if (handle == null || !useDefault && !handle.isSet()) {
    return null;
  }
  if (handle.isKeyword()) {
    return new DimensionType(handle.getStringValue());
  }
  double measure=handle.getMeasure();
  String unit=handle.getUnits();
  return new DimensionType(measure,unit);
}

Fixed version (ground truth):
protected DimensionType createDimension(DimensionHandle handle,boolean useDefault){
  if (handle == null || !useDefault && !handle.isSet()) {
    return null;
  }
  if (handle.isKeyword()) {
    return new DimensionType(handle.getStringValue());
  }
  double measure=handle.getMeasure();
  String unit=handle.getUnits();
  if (unit == null || unit.length() == 0) {
    unit=handle.getDefaultUnit();
  }
  return new DimensionType(measure,unit);
}
Program: 71720
Project: 71720
Buggy source:
public void setWidth(String width){
  content.setWidth(DimensionType.parserUnit(width));
}

Fixed version (ground truth):
public void setWidth(String width){
  String unit=content.getReportContent().getDesign().getReportDesign().getDefaultUnits();
  content.setWidth(DimensionType.parserUnit(width,unit));
}
Program: 71721
Project: 71721
Buggy source:
public void close() throws BirtException {
  if (state == CLOSED)   return;
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    while (this.next())     ;
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (state == CLOSED)   return;
  this.resultService.getSession().getEngine().removeListener(listener);
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    while (this.next())     ;
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}
Program: 71722
Project: 71722
Buggy source:
/** 
 * Evaluate parameter values.
 * @param runnable
 * @return
 */
private HashMap evaluateParameterValues(IReportRunnable runnable){
  HashMap inputValues=new HashMap();
  IGetParameterDefinitionTask task=engine.createGetParameterDefinitionTask(runnable);
  Collection paramDefns=task.getParameterDefns(false);
  Iterator iter=paramDefns.iterator();
  while (iter.hasNext()) {
    IParameterDefnBase pBase=(IParameterDefnBase)iter.next();
    if (pBase instanceof IScalarParameterDefn) {
      IScalarParameterDefn paramDefn=(IScalarParameterDefn)pBase;
      String paramName=paramDefn.getName();
      String inputValue=(String)params.get(paramName);
      int paramType=paramDefn.getDataType();
      try {
        Object paramValue=stringToObject(paramType,inputValue);
        if (paramValue != null) {
          inputValues.put(paramName,paramValue);
        }
      }
 catch (      BirtException ex) {
        logger.log(Level.SEVERE,"String_Node_Str" + paramName + "String_Node_Str",ex);
      }
    }
  }
  return inputValues;
}

Fixed version (ground truth):
/** 
 * Evaluate parameter values.
 * @param runnable
 * @return
 */
private HashMap evaluateParameterValues(IReportRunnable runnable){
  HashMap inputValues=new HashMap();
  IGetParameterDefinitionTask task=engine.createGetParameterDefinitionTask(runnable);
  Collection paramDefns=task.getParameterDefns(false);
  Iterator iter=paramDefns.iterator();
  while (iter.hasNext()) {
    IParameterDefnBase pBase=(IParameterDefnBase)iter.next();
    if (pBase instanceof IScalarParameterDefn) {
      IScalarParameterDefn paramDefn=(IScalarParameterDefn)pBase;
      String paramName=paramDefn.getName();
      String inputValue=(String)params.get(paramName);
      int paramDataType=paramDefn.getDataType();
      String paramType=paramDefn.getScalarParameterType();
      try {
        Object paramValue=null;
        if (DesignChoiceConstants.SCALAR_PARAM_TYPE_MULTI_VALUE.equals(paramType)) {
          paramValue=stringToObjectArray(paramDataType,inputValue);
        }
 else {
          paramValue=stringToObject(paramDataType,inputValue);
        }
        if (paramValue != null) {
          inputValues.put(paramName,paramValue);
        }
      }
 catch (      BirtException ex) {
        logger.log(Level.SEVERE,"String_Node_Str" + paramName + "String_Node_Str",ex);
      }
    }
  }
  return inputValues;
}
Program: 71723
Project: 71723
Buggy source:
private void addQueryColumnBindings(IBaseQueryDefinition query,ITotalExprBindings totalExpressionBindings) throws BirtException {
  IBinding[] bindings=totalExpressionBindings.getColumnBindings();
  if (bindings != null) {
    for (int i=0; i < bindings.length; i++) {
      query.addBinding(bindings[i]);
    }
  }
}

Fixed version (ground truth):
private void addQueryColumnBindings(IBaseQueryDefinition query,ITotalExprBindings totalExpressionBindings) throws BirtException {
  IBinding[] bindings=totalExpressionBindings.getColumnBindings();
  if (bindings != null) {
    for (int i=0; i < bindings.length; i++) {
      bindings[i].setExportable(false);
      query.addBinding(bindings[i]);
    }
  }
}
Program: 71724
Project: 71724
Buggy source:
public static TableInfo createTable(ITableContent table,int width){
  width=getElementWidth(table,width);
  int colcount=table.getColumnCount();
  if (colcount == 0) {
    return null;
  }
  int[] index=new int[colcount];
  int know=0;
  List unmount=new ArrayList();
  for (int i=0; i < colcount; i++) {
    DimensionType value=table.getColumn(i).getWidth();
    if (value == null) {
      unmount.add(new Integer(i));
    }
 else {
      try {
        index[i]=ExcelUtil.covertDimensionType(value,width);
        know+=index[i];
      }
 catch (      IllegalArgumentException ex) {
        unmount.add(new Integer(i));
      }
    }
  }
  int left=width - know;
  if (left > 0 && unmount.size() == 0) {
    index[index.length - 1]=index[index.length - 1] + left;
    return new DefaultTableInfo(index);
  }
 else   if (left > 0 && unmount.size() > 0) {
    int[] size=split(left,unmount.size());
    Iterator iter=unmount.iterator();
    int i=0;
    while (iter.hasNext()) {
      int pos=((Integer)iter.next()).intValue();
      index[pos]=size[i];
      i++;
    }
    return new DefaultTableInfo(index);
  }
 else {
    return new DefaultTableInfo(index);
  }
}

Fixed version (ground truth):
public static TableInfo createTable(ITableContent table,int width){
  width=getElementWidth(table,width);
  int colcount=table.getColumnCount();
  if (colcount == 0) {
    return null;
  }
  int[] index=new int[colcount];
  int know=0;
  List unmount=new ArrayList();
  for (int i=0; i < colcount; i++) {
    DimensionType value=table.getColumn(i).getWidth();
    if (value == null) {
      unmount.add(new Integer(i));
    }
 else {
      try {
        index[i]=ExcelUtil.covertDimensionType(value,width);
        know+=index[i];
      }
 catch (      IllegalArgumentException ex) {
        unmount.add(new Integer(i));
      }
    }
  }
  int left=width - know;
  if (left > 0 && unmount.size() == 0) {
    index[index.length - 1]=index[index.length - 1] + left;
    return new DefaultTableInfo(index);
  }
 else   if (left < 0) {
    return new DefaultTableInfo(split(width,colcount));
  }
 else   if (left > 0 && unmount.size() > 0) {
    int[] size=split(left,unmount.size());
    Iterator iter=unmount.iterator();
    int i=0;
    while (iter.hasNext()) {
      int pos=((Integer)iter.next()).intValue();
      index[pos]=size[i];
      i++;
    }
    return new DefaultTableInfo(index);
  }
 else {
    return new DefaultTableInfo(index);
  }
}
Program: 71725
Project: 71725
Buggy source:
public String getHyperlink(){
  return content.getHyperlinkAction().getHyperlink();
}

Fixed version (ground truth):
public String getHyperlink(){
  IHyperlinkAction hyperlinkAction=content.getHyperlinkAction();
  return hyperlinkAction == null ? null : hyperlinkAction.getHyperlink();
}
Program: 71726
Project: 71726
Buggy source:
private static double getDouble(Object o) throws BirtException {
  if (o == null)   return 0;
  return DataTypeUtil.toDouble(o);
}

Fixed version (ground truth):
private static double getDouble(Object o) throws BirtException {
  if (o == null)   return Double.NaN;
  return DataTypeUtil.toDouble(o);
}
Program: 71727
Project: 71727
Buggy source:
public Object evaluate(ScriptContext context,Scriptable scope) throws DataException {
  Object temp=this.script.exec(context.getContext(),scope);
  temp=JavascriptEvalUtil.convertJavascriptValue(temp);
  if (temp instanceof ScriptableObject) {
    return ((ScriptableObject)temp).getDefaultValue(null);
  }
  return temp;
}

Fixed version (ground truth):
public Object evaluate(ScriptContext context,Scriptable scope) throws DataException {
  Object temp=null;
  try {
    temp=this.script.exec(context.getContext(),scope);
    temp=JavascriptEvalUtil.convertJavascriptValue(temp);
    if (temp instanceof ScriptableObject) {
      return ((ScriptableObject)temp).getDefaultValue(null);
    }
  }
 catch (  EvaluatorException e) {
    throw new DataException(e.details(),e);
  }
  return temp;
}
Program: 71728
Project: 71728
Buggy source:
public ComputedColumnAdapter(ComputedColumnHandle modelCmptdColumn) throws AdapterException {
  super(modelCmptdColumn.getName(),modelCmptdColumn.getExpression(),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(modelCmptdColumn.getDataType()),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelAggregationType(modelCmptdColumn.getAggregateFunction()),modelCmptdColumn.getFilterExpression() == null ? null : new ScriptExpression(modelCmptdColumn.getFilterExpression()),populateArgument(modelCmptdColumn));
}

Fixed version (ground truth):
public ComputedColumnAdapter(ComputedColumnHandle modelCmptdColumn) throws AdapterException {
  super(modelCmptdColumn.getName(),modelCmptdColumn.getExpression(),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(modelCmptdColumn.getDataType()),modelCmptdColumn.getAggregateFunction(),modelCmptdColumn.getFilterExpression() == null ? null : new ScriptExpression(modelCmptdColumn.getFilterExpression()),populateArgument(modelCmptdColumn));
}
Program: 71729
Project: 71729
Buggy source:
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  List argument=new ArrayList();
  Iterator it=modelCmptdColumn.argumentsIterator();
  while (it != null && it.hasNext()) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)it.next();
    if (arg.getValue() != null)     argument.add(new ScriptExpression(arg.getValue()));
 else     argument.add(new ScriptExpression(null));
  }
  return argument;
}

Fixed version (ground truth):
/** 
 * Populate the arguments to a List by the order of the IAggrFunction saved
 * @param modelCmptdColumn
 * @return
 */
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  Map argumentList=new HashMap();
  Iterator argumentIter=modelCmptdColumn.argumentsIterator();
  while (argumentIter.hasNext()) {
    AggregationArgumentHandle handle=(AggregationArgumentHandle)argumentIter.next();
    argumentList.put(handle.getName(),new ScriptExpression(handle.getValue()));
  }
  List orderedArgument=new ArrayList();
  if (modelCmptdColumn.getAggregateFunction() != null) {
    IAggrFunction info=null;
    try {
      info=AggregationManager.getInstance().getAggregation(modelCmptdColumn.getAggregateFunction());
    }
 catch (    DataException e) {
      e.printStackTrace();
    }
    if (info != null) {
      IParameterDefn[] parameters=info.getParameterDefn();
      if (parameters != null) {
        for (int i=0; i < parameters.length; i++) {
          IParameterDefn pInfo=parameters[i];
          if (argumentList.get(pInfo.getName()) != null) {
            orderedArgument.add(argumentList.get(pInfo.getName()));
          }
        }
      }
    }
  }
  return orderedArgument;
}
Program: 71730
Project: 71730
Buggy source:
/** 
 * @param design
 * @param odaStatement
 * @return
 * @throws DataException
 */
private IResultClass getMetaData(IOdaDataSetDesign design,PreparedStatement odaStatement) throws DataException {
  IResultClass result=null;
  if (design != null) {
    if (canAccessResultSetByName(design)) {
      result=odaStatement.getMetaData(design.getPrimaryResultSetName());
    }
 else     if (canAccessResultSetByNumber(design)) {
      result=odaStatement.getMetaData(design.getPrimaryResultSetNumber());
    }
  }
  if (result == null)   result=odaStatement.getMetaData();
  return result;
}

Fixed version (ground truth):
/** 
 * @param design
 * @param odaStatement
 * @return
 * @throws DataException
 */
private IResultClass getMetaData(IOdaDataSetDesign design,PreparedStatement odaStatement) throws DataException {
  IResultClass result=null;
  if (design != null) {
    if (canAccessResultSetByName(design)) {
      try {
        result=odaStatement.getMetaData(design.getPrimaryResultSetName());
      }
 catch (      DataException e) {
        throw new DataException(ResourceConstants.ERROR_HAPPEN_WHEN_RETRIEVE_RESULTSET,design.getPrimaryResultSetName());
      }
    }
 else     if (canAccessResultSetByNumber(design)) {
      try {
        result=odaStatement.getMetaData(design.getPrimaryResultSetNumber());
      }
 catch (      DataException e) {
        throw new DataException(ResourceConstants.ERROR_HAPPEN_WHEN_RETRIEVE_RESULTSET,design.getPrimaryResultSetNumber());
      }
    }
  }
  if (result == null)   result=odaStatement.getMetaData();
  return result;
}
Program: 71734
Project: 71734
Buggy source:
public ComputedColumnAdapter(ComputedColumnHandle modelCmptdColumn) throws AdapterException {
  super(modelCmptdColumn.getName(),modelCmptdColumn.getExpression(),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(modelCmptdColumn.getDataType()),modelCmptdColumn.getAggregateFunction(),modelCmptdColumn.getFilterExpression() == null ? null : new ScriptExpression(modelCmptdColumn.getFilterExpression()),populateArgument(modelCmptdColumn));
}

Fixed version (ground truth):
public ComputedColumnAdapter(ComputedColumnHandle modelCmptdColumn) throws AdapterException {
  super(modelCmptdColumn.getName(),modelCmptdColumn.getExpression(),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(modelCmptdColumn.getDataType()),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelAggregationType(modelCmptdColumn.getAggregateFunction()),modelCmptdColumn.getFilterExpression() == null ? null : new ScriptExpression(modelCmptdColumn.getFilterExpression()),populateArgument(modelCmptdColumn));
}
Program: 71735
Project: 71735
Buggy source:
/** 
 * Populate the arguments to a List by the order of the IAggrFunction saved
 * @param modelCmptdColumn
 * @return
 */
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  Map argumentList=new HashMap();
  Iterator argumentIter=modelCmptdColumn.argumentsIterator();
  while (argumentIter.hasNext()) {
    AggregationArgumentHandle handle=(AggregationArgumentHandle)argumentIter.next();
    argumentList.put(handle.getName(),new ScriptExpression(handle.getValue()));
  }
  List orderedArgument=new ArrayList();
  if (modelCmptdColumn.getAggregateFunction() != null) {
    IAggrFunction info=null;
    try {
      info=AggregationManager.getInstance().getAggregation(modelCmptdColumn.getAggregateFunction());
    }
 catch (    DataException e) {
      e.printStackTrace();
    }
    if (info != null) {
      IParameterDefn[] parameters=info.getParameterDefn();
      if (parameters != null) {
        for (int i=0; i < parameters.length; i++) {
          IParameterDefn pInfo=parameters[i];
          if (argumentList.get(pInfo.getName()) != null) {
            orderedArgument.add(argumentList.get(pInfo.getName()));
          }
        }
      }
    }
  }
  return orderedArgument;
}

Fixed version (ground truth):
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  List argument=new ArrayList();
  Iterator it=modelCmptdColumn.argumentsIterator();
  while (it != null && it.hasNext()) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)it.next();
    if (arg.getValue() != null)     argument.add(new ScriptExpression(arg.getValue()));
 else     argument.add(new ScriptExpression(null));
  }
  return argument;
}
Program: 71737
Project: 71737
Buggy source:
public ComputedColumnAdapter(ComputedColumnHandle modelCmptdColumn) throws AdapterException {
  super(modelCmptdColumn.getName(),modelCmptdColumn.getExpression(),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(modelCmptdColumn.getDataType()),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelAggregationType(modelCmptdColumn.getAggregateFunction()),modelCmptdColumn.getFilterExpression() == null ? null : new ScriptExpression(modelCmptdColumn.getFilterExpression()),populateArgument(modelCmptdColumn));
}

Fixed version (ground truth):
public ComputedColumnAdapter(ComputedColumnHandle modelCmptdColumn) throws AdapterException {
  super(modelCmptdColumn.getName(),modelCmptdColumn.getExpression(),org.eclipse.birt.report.data.adapter.api.DataAdapterUtil.adaptModelDataType(modelCmptdColumn.getDataType()),modelCmptdColumn.getAggregateFunction(),modelCmptdColumn.getFilterExpression() == null ? null : new ScriptExpression(modelCmptdColumn.getFilterExpression()),populateArgument(modelCmptdColumn));
}
Program: 71738
Project: 71738
Buggy source:
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  List argument=new ArrayList();
  Iterator it=modelCmptdColumn.argumentsIterator();
  while (it != null && it.hasNext()) {
    AggregationArgumentHandle arg=(AggregationArgumentHandle)it.next();
    if (arg.getValue() != null)     argument.add(new ScriptExpression(arg.getValue()));
 else     argument.add(new ScriptExpression(null));
  }
  return argument;
}

Fixed version (ground truth):
/** 
 * Populate the arguments to a List by the order of the IAggrFunction saved
 * @param modelCmptdColumn
 * @return
 */
private static List populateArgument(ComputedColumnHandle modelCmptdColumn){
  Map argumentList=new HashMap();
  Iterator argumentIter=modelCmptdColumn.argumentsIterator();
  while (argumentIter.hasNext()) {
    AggregationArgumentHandle handle=(AggregationArgumentHandle)argumentIter.next();
    argumentList.put(handle.getName(),new ScriptExpression(handle.getValue()));
  }
  List orderedArgument=new ArrayList();
  if (modelCmptdColumn.getAggregateFunction() != null) {
    IAggrFunction info=null;
    try {
      info=AggregationManager.getInstance().getAggregation(modelCmptdColumn.getAggregateFunction());
    }
 catch (    DataException e) {
      e.printStackTrace();
    }
    if (info != null) {
      IParameterDefn[] parameters=info.getParameterDefn();
      if (parameters != null) {
        for (int i=0; i < parameters.length; i++) {
          IParameterDefn pInfo=parameters[i];
          if (argumentList.get(pInfo.getName()) != null) {
            orderedArgument.add(argumentList.get(pInfo.getName()));
          }
        }
      }
    }
  }
  return orderedArgument;
}
Program: 71739
Project: 71739
Buggy source:
private void initializeRuntimeContext(IDataRowExpressionEvaluator rowAdapter){
  rtc.setActionRenderer(new BIRTActionRenderer(this.handle,this.ah,rowAdapter,this.context));
  rtc.setMessageLookup(new BIRTMessageLookup(context));
  rtc.setRightToLeft(handle.isDirectionRTL());
  rtc.setRightToLeftText(DesignChoiceConstants.BIDI_DIRECTION_RTL.equals(handle.getPrivateStyle().getTextDirection()));
  rtc.setResourceFinder((ChartReportItemImpl)getReportItem(handle));
  rtc.setExternalizer((ChartReportItemImpl)getReportItem(handle));
}

Fixed version (ground truth):
private void initializeRuntimeContext(IDataRowExpressionEvaluator rowAdapter){
  rtc.setActionRenderer(new BIRTActionRenderer(this.handle,this.ah,rowAdapter,this.context));
  rtc.setMessageLookup(new BIRTMessageLookup(context));
  rtc.setRightToLeft(handle.isDirectionRTL());
  ChartReportItemImpl crii=(ChartReportItemImpl)getReportItem(handle);
  rtc.setRightToLeftText(crii.isBIDIDirectionRTL());
  rtc.setResourceFinder(crii);
  rtc.setExternalizer(crii);
}
Program: 71741
Project: 71741
Buggy source:
/** 
 * This method create a ResourceIdentifiers instance which is in turn being passed to appContext. The consumer of appContext, especially those Oda drivers, can then use it for acquire Resource info.
 * @param handle
 * @return
 */
private static ResourceIdentifiers createResourceIdentifiers(ModuleHandle handle){
  if (handle == null)   return null;
  try {
    ResourceIdentifiers identifiers=new ResourceIdentifiers();
    identifiers.setDesignResourceBaseURI(handle.getSystemId().toURI());
    identifiers.setApplResourceBaseURI(new File(handle.getResourceFolder()).toURI());
    return identifiers;
  }
 catch (  URISyntaxException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * This method create a ResourceIdentifiers instance which is in turn being passed to appContext. The consumer of appContext, especially those Oda drivers, can then use it for acquire Resource info.
 * @param handle
 * @return
 */
private static ResourceIdentifiers createResourceIdentifiers(ModuleHandle handle){
  if (handle == null)   return null;
  try {
    ResourceIdentifiers identifiers=new ResourceIdentifiers();
    if (handle.getSystemId() != null) {
      identifiers.setDesignResourceBaseURI(handle.getSystemId().toURI());
    }
    if (handle.getResourceFolder() != null) {
      identifiers.setApplResourceBaseURI(new File(handle.getResourceFolder()).toURI());
    }
    return identifiers;
  }
 catch (  URISyntaxException e) {
    return null;
  }
}
Program: 71743
Project: 71743
Buggy source:
/** 
 * This method create a ResourceIdentifiers instance which is in turn being passed to appContext. The consumer of appContext, especially those Oda drivers, can then use it for acquire Resource info.
 * @param handle
 * @return
 */
private static ResourceIdentifiers createResourceIdentifiers(ModuleHandle handle){
  if (handle == null)   return null;
  try {
    ResourceIdentifiers identifiers=new ResourceIdentifiers();
    identifiers.setDesignResourceBaseURI(handle.getSystemId().toURI());
    identifiers.setApplResourceBaseURI(new File(handle.getResourceFolder()).toURI());
    return identifiers;
  }
 catch (  URISyntaxException e) {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * This method create a ResourceIdentifiers instance which is in turn being passed to appContext. The consumer of appContext, especially those Oda drivers, can then use it for acquire Resource info.
 * @param handle
 * @return
 */
private static ResourceIdentifiers createResourceIdentifiers(ModuleHandle handle){
  if (handle == null)   return null;
  try {
    ResourceIdentifiers identifiers=new ResourceIdentifiers();
    if (handle.getSystemId() != null) {
      identifiers.setDesignResourceBaseURI(handle.getSystemId().toURI());
    }
    if (handle.getResourceFolder() != null) {
      identifiers.setApplResourceBaseURI(new File(handle.getResourceFolder()).toURI());
    }
    return identifiers;
  }
 catch (  URISyntaxException e) {
    return null;
  }
}
Program: 71744
Project: 71744
Buggy source:
public void testReterive() throws BirtException {
  try {
    context.eval("String_Node_Str");
    fail();
  }
 catch (  JavaScriptException e) {
    assertTrue(true);
  }
  assertEquals("String_Node_Str",context.eval("String_Node_Str"));
  assertEquals("String_Node_Str",context.eval("String_Node_Str"));
  assertEquals("String_Node_Str",context.eval("String_Node_Str"));
  assertEquals("String_Node_Str",context.eval("String_Node_Str"));
  assertEquals("String_Node_Str",context.eval("String_Node_Str" + "String_Node_Str"));
}

Fixed version (ground truth):
public void testReterive() throws BirtException {
  try {
    context.eval("String_Node_Str");
    fail();
  }
 catch (  BirtException e) {
    assertTrue(true);
  }
  assertEquals("String_Node_Str",context.eval("String_Node_Str"));
  assertEquals("String_Node_Str",context.eval("String_Node_Str"));
  assertEquals("String_Node_Str",context.eval("String_Node_Str"));
  assertEquals("String_Node_Str",context.eval("String_Node_Str"));
  assertEquals("String_Node_Str",context.eval("String_Node_Str" + "String_Node_Str"));
}
Program: 71745
Project: 71745
Buggy source:
/** 
 * Convert String without specified locale to java.util.Date Try to format the given String for JRE default Locale, if it fails, try to format the String for Locale.US 
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDate(String source) throws BirtException {
  try {
    return toDateISO8601(source);
  }
 catch (  BirtException e) {
    try {
      return toDate(source,JRE_DEFAULT_LOCALE);
    }
 catch (    BirtException use) {
      return toDate(source,DEFAULT_LOCALE);
    }
  }
}

Fixed version (ground truth):
/** 
 * Convert String without specified locale to java.util.Date Try to format the given String for JRE default Locale, if it fails, try to format the String for Locale.US 
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDate(String source) throws BirtException {
  try {
    return toDateISO8601(source,null);
  }
 catch (  BirtException e) {
    try {
      return toDate(source,JRE_DEFAULT_LOCALE);
    }
 catch (    BirtException use) {
      return toDate(source,DEFAULT_LOCALE);
    }
  }
}
Program: 71746
Project: 71746
Buggy source:
/** 
 * convert String with ISO8601 date format to java.util.Date
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDateISO8601(String source) throws BirtException {
  Date resultDate=null;
  try {
    resultDate=DateFormatISO8601.parse(source);
    return resultDate;
  }
 catch (  ParseException e1) {
    throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
  }
}

Fixed version (ground truth):
/** 
 * convert String with ISO8601 date format to java.util.Date
 * @param source the String to be convert
 * @param locate the locate of the string
 * @return result Date
 */
private static Date toDateISO8601(String source,TimeZone timeZone) throws BirtException {
  Date resultDate=null;
  try {
    resultDate=DateFormatISO8601.parse(source,timeZone);
    return resultDate;
  }
 catch (  ParseException e1) {
    throw new CoreException(ResourceConstants.CONVERT_FAILS,new Object[]{source.toString(),"String_Node_Str"});
  }
}