nus-yam/ex-repair huggingface dataset:
Program: 69634
Project: 69634
Buggy source:
/** 
 * @throws BirtException
 */
private void genBasic() throws BirtException {
  QueryDefinition qd=newReportQuery();
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  rowExprName=getRowExprName();
  totalExprName=getAggrExprName();
  prepareExprNameAndQuery(rowExprName,rowBeArray,totalExprName,totalBeArray,qd);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  saveForPresentation(qr,rowBeArray,totalBeArray);
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    for (int i=0; i < rowBeArray.length; i++)     expectedValue.add(ri.getValue(rowExprName[i]));
    for (int i=0; i < totalBeArray.length; i++)     expectedValue.add(ri.getValue(totalExprName[i]));
  }
  ri.close();
  ri.close();
  qr.close();
  qr.close();
  myGenDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void genBasic() throws BirtException {
  QueryDefinition qd=newReportQuery();
  IBaseExpression[] rowBeArray=getRowExpr();
  rowExprName=getRowExprName();
  totalExprName=getAggrExprName();
  prepareExprNameAndQuery(qd);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  saveForPresentation(qr);
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    for (int i=0; i < rowBeArray.length; i++)     expectedValue.add(ri.getValue(rowExprName[i]));
    for (int i=0; i < totalExprName.length; i++)     expectedValue.add(ri.getValue(totalExprName[i]));
  }
  ri.close();
  ri.close();
  qr.close();
  qr.close();
  myGenDataEngine.shutdown();
}
Program: 69636
Project: 69636
Buggy source:
/** 
 * @throws BirtException
 */
private void genSubQuery() throws BirtException {
  QueryDefinition queryDefn=newReportQuery();
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyColumn("String_Node_Str");
  queryDefn.addGroup(groupDefn);
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  rowExprName=getRowExprName();
  totalExprName=getAggrExprName();
  prepareExprNameAndQuery(rowExprName,rowBeArray,totalExprName,totalBeArray,queryDefn);
  SubqueryDefinition subQueryDefn=new SubqueryDefinition(subQueryName,queryDefn);
  groupDefn.addSubquery(subQueryDefn);
  SortDefinition sortDefn=new SortDefinition();
  sortDefn.setColumn("String_Node_Str");
  sortDefn.setSortDirection(ISortDefinition.SORT_DESC);
  subQueryDefn.addSort(sortDefn);
  prepareExprNameAndQuery(rowExprName,rowBeArray,totalExprName,totalBeArray,subQueryDefn);
  IQueryResults qr=myGenDataEngine.prepare(queryDefn).execute(scope);
  saveForPresentation(qr,rowBeArray,totalBeArray);
  IResultIterator ri=qr.getResultIterator();
  int loopCount=5;
  for (int i=0; i < loopCount; i++)   ri.next();
  IResultIterator ri2=ri.getSecondaryIterator(subQueryName,subScope);
  while (ri2.next()) {
    for (int i=0; i < rowBeArray.length; i++)     expectedValue.add(ri2.getValue(rowExprName[i]));
    for (int i=0; i < totalBeArray.length; i++)     expectedValue.add(ri2.getValue(totalExprName[i]));
  }
  ri2.close();
  qr.close();
  myGenDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void genSubQuery() throws BirtException {
  QueryDefinition queryDefn=newReportQuery();
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyColumn("String_Node_Str");
  queryDefn.addGroup(groupDefn);
  prepareExprNameAndQuery(queryDefn);
  SubqueryDefinition subQueryDefn=new SubqueryDefinition(subQueryName,queryDefn);
  groupDefn.addSubquery(subQueryDefn);
  SortDefinition sortDefn=new SortDefinition();
  sortDefn.setColumn("String_Node_Str");
  sortDefn.setSortDirection(ISortDefinition.SORT_DESC);
  subQueryDefn.addSort(sortDefn);
  prepareExprNameAndQuery(subQueryDefn);
  IQueryResults qr=myGenDataEngine.prepare(queryDefn).execute(scope);
  saveForPresentation(qr);
  IResultIterator ri=qr.getResultIterator();
  int loopCount=5;
  for (int i=0; i < loopCount; i++)   ri.next();
  IResultIterator ri2=ri.getSecondaryIterator(subQueryName,subScope);
  while (ri2.next()) {
    for (int i=0; i < rowExprName.length; i++)     expectedValue.add(ri2.getValue(rowExprName[i]));
    for (int i=0; i < totalExprName.length; i++)     expectedValue.add(ri2.getValue(totalExprName[i]));
  }
  ri2.close();
  qr.close();
  myGenDataEngine.shutdown();
}
Program: 69637
Project: 69637
Buggy source:
/** 
 * @return aggregation expression array
 */
private IBaseExpression[] getAggrExpr(){
  int num2=2;
  IBaseExpression[] totalBeArray=new IBaseExpression[num2];
  totalBeArray[0]=new ScriptExpression("String_Node_Str");
  totalBeArray[1]=new ScriptExpression("String_Node_Str");
  return totalBeArray;
}

Fixed version (ground truth):
/** 
 * @return aggregation expression array
 */
private IBaseExpression[] getAggrExpr(){
  int num2=2;
  IBaseExpression[] totalBeArray=new IBaseExpression[num2];
  totalBeArray[0]=new ScriptExpression(null);
  totalBeArray[1]=new ScriptExpression("String_Node_Str");
  return totalBeArray;
}
Program: 69638
Project: 69638
Buggy source:
/** 
 * Add expression on the row of group
 * @param rowBeArray
 * @param totalBeArray
 * @param qd
 */
private void prepareExprNameAndQuery(String[] rowBeName,IBaseExpression[] rowBeArray,String[] totalBeName,IBaseExpression[] totalBeArray,BaseQueryDefinition qd){
  for (int i=0; i < rowBeName.length; i++)   qd.addResultSetExpression(rowBeName[i],rowBeArray[i]);
  for (int i=0; i < totalBeName.length; i++)   qd.addResultSetExpression(totalBeName[i],totalBeArray[i]);
}

Fixed version (ground truth):
private void prepareExprNameAndQuery(BaseQueryDefinition qd) throws DataException {
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=new IBaseExpression[2];
  this.rowExprName=this.getRowExprName();
  totalBeArray[0]=new ScriptExpression(null);
  totalBeArray[1]=new ScriptExpression("String_Node_Str");
  totalExprName=new String[totalBeArray.length];
  this.totalExprName[0]="String_Node_Str";
  this.totalExprName[1]="String_Node_Str";
  IBinding total1=new Binding(this.totalExprName[0],totalBeArray[0]);
  total1.setAggrFunction("String_Node_Str");
  IBinding total2=new Binding(this.totalExprName[1],totalBeArray[1]);
  total2.setAggrFunction("String_Node_Str");
  qd.addBinding(total1);
  qd.addBinding(total2);
  for (int i=0; i < rowExprName.length; i++) {
    qd.addBinding(new Binding(this.rowExprName[i],rowBeArray[i]));
  }
}
Program: 69640
Project: 69640
Buggy source:
/** 
 * @throws BirtException 
 */
private void genBasicGroupLevel() throws BirtException {
  QueryDefinition qd=newReportQuery();
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  rowExprName=getRowExprName();
  totalExprName=getAggrExprName();
  prepareExprNameAndQuery(rowExprName,rowBeArray,totalExprName,totalBeArray,qd);
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyColumn("String_Node_Str");
  qd.addGroup(groupDefn);
  groupDefn=new GroupDefinition();
  groupDefn.setKeyColumn("String_Node_Str");
  qd.addGroup(groupDefn);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  saveForPresentation(qr,rowBeArray,totalBeArray);
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    for (int i=0; i < rowBeArray.length; i++)     expectedValue.add(ri.getValue(rowExprName[i]));
    for (int i=0; i < totalBeArray.length; i++)     expectedValue.add(ri.getValue(totalExprName[i]));
    this.expectedStartingGroupLevelValueList.add(new Integer(ri.getStartingGroupLevel()));
    this.expectedEndingGroupLevelValueList.add(new Integer(ri.getEndingGroupLevel()));
  }
  ri.close();
  ri.close();
  qr.close();
  qr.close();
  myGenDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException 
 */
private void genBasicGroupLevel() throws BirtException {
  QueryDefinition qd=newReportQuery();
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  rowExprName=getRowExprName();
  totalExprName=getAggrExprName();
  prepareExprNameAndQuery(qd);
  GroupDefinition groupDefn=new GroupDefinition();
  groupDefn.setKeyColumn("String_Node_Str");
  qd.addGroup(groupDefn);
  groupDefn=new GroupDefinition();
  groupDefn.setKeyColumn("String_Node_Str");
  qd.addGroup(groupDefn);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  saveForPresentation(qr);
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    for (int i=0; i < rowBeArray.length; i++)     expectedValue.add(ri.getValue(rowExprName[i]));
    for (int i=0; i < totalBeArray.length; i++)     expectedValue.add(ri.getValue(totalExprName[i]));
    this.expectedStartingGroupLevelValueList.add(new Integer(ri.getStartingGroupLevel()));
    this.expectedEndingGroupLevelValueList.add(new Integer(ri.getEndingGroupLevel()));
  }
  ri.close();
  ri.close();
  qr.close();
  qr.close();
  myGenDataEngine.shutdown();
}
Program: 69641
Project: 69641
Buggy source:
private void genSkipToEnd(boolean useDetails) throws BirtException {
  Context context=Context.enter();
  Scriptable scope=context.initStandardObjects();
  Context.exit();
  QueryDefinition qd=newReportQuery();
  qd.setUsesDetails(useDetails);
  GroupDefinition gd=new GroupDefinition();
  String columnBindingNameGroup="String_Node_Str";
  IBaseExpression columnBindingExprGroup=new ScriptExpression("String_Node_Str");
  gd.setKeyColumn("String_Node_Str");
  qd.addResultSetExpression(columnBindingNameGroup,columnBindingExprGroup);
  qd.addGroup(gd);
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  prepareExprNameAndQuery(rowBeArray,totalBeArray,qd);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  ri.next();
  ri.moveTo(4);
  ri.skipToEnd(1);
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
}

Fixed version (ground truth):
private void genSkipToEnd(boolean useDetails) throws BirtException {
  Context context=Context.enter();
  Scriptable scope=context.initStandardObjects();
  Context.exit();
  QueryDefinition qd=newReportQuery();
  qd.setUsesDetails(useDetails);
  GroupDefinition gd=new GroupDefinition();
  String columnBindingNameGroup="String_Node_Str";
  IBaseExpression columnBindingExprGroup=new ScriptExpression("String_Node_Str");
  gd.setKeyColumn("String_Node_Str");
  qd.addBinding(new Binding(columnBindingNameGroup,columnBindingExprGroup));
  qd.addGroup(gd);
  prepareExprNameAndQuery(qd);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  ri.next();
  ri.moveTo(4);
  ri.skipToEnd(1);
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
}
Program: 69642
Project: 69642
Buggy source:
private void genHasGapRs() throws BirtException {
  Context context=Context.enter();
  Scriptable scope=context.initStandardObjects();
  Context.exit();
  QueryDefinition qd=newReportQuery();
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  prepareExprNameAndQuery(rowBeArray,totalBeArray,qd);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  ri.next();
  ri.moveTo(3);
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
}

Fixed version (ground truth):
private void genHasGapRs() throws BirtException {
  Context context=Context.enter();
  Scriptable scope=context.initStandardObjects();
  Context.exit();
  QueryDefinition qd=newReportQuery();
  prepareExprNameAndQuery(qd);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  ri.next();
  ri.moveTo(3);
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
}
Program: 69643
Project: 69643
Buggy source:
/** 
 * Add expression on the row of group
 * @param rowBeArray
 * @param totalBeArray
 * @param qd
 */
private void prepareExprNameAndQuery(IBaseExpression[] rowBeArray,IBaseExpression[] totalBeArray,BaseQueryDefinition qd){
  int num=rowBeArray.length;
  for (int i=0; i < num; i++)   qd.addResultSetExpression(this.rowExprName[i],rowBeArray[i]);
  if (totalBeArray != null) {
    int num2=totalBeArray.length;
    for (int i=0; i < num2; i++)     qd.addResultSetExpression(this.totalExprName[i],totalBeArray[i]);
  }
}

Fixed version (ground truth):
/** 
 * Add expression on the row of group
 * @param rowBeArray
 * @param totalBeArray
 * @param qd
 * @throws DataException 
 */
private void prepareExprNameAndQuery(BaseQueryDefinition qd) throws DataException {
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=new IBaseExpression[2];
  totalBeArray[0]=new ScriptExpression(null);
  totalBeArray[1]=new ScriptExpression("String_Node_Str");
  totalExprName=new String[totalBeArray.length];
  this.totalExprName[0]="String_Node_Str";
  this.totalExprName[1]="String_Node_Str";
  IBinding total1=new Binding(this.totalExprName[0],totalBeArray[0]);
  total1.setAggrFunction("String_Node_Str");
  IBinding total2=new Binding(this.totalExprName[1],totalBeArray[1]);
  total2.setAggrFunction("String_Node_Str");
  qd.addBinding(total1);
  qd.addBinding(total2);
  for (int i=0; i < rowExprName.length; i++) {
    qd.addBinding(new Binding(this.rowExprName[i],rowBeArray[i]));
  }
}
Program: 69644
Project: 69644
Buggy source:
/** 
 * @throws Exception
 */
private void genBasic() throws Exception {
  Context context=Context.enter();
  Scriptable scope=context.initStandardObjects();
  Context.exit();
  QueryDefinition qd=newReportQuery();
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  prepareExprNameAndQuery(rowBeArray,totalBeArray,qd);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    ri.getValue(this.rowExprName[0]);
    ri.getValue(this.totalExprName[0]);
  }
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws Exception
 */
private void genBasic() throws Exception {
  Context context=Context.enter();
  Scriptable scope=context.initStandardObjects();
  Context.exit();
  QueryDefinition qd=newReportQuery();
  prepareExprNameAndQuery(qd);
  IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
  queryResultID=qr.getID();
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    ri.getValue(this.rowExprName[0]);
    ri.getValue(this.totalExprName[0]);
  }
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
}
Program: 69649
Project: 69649
Buggy source:
public void setUp() throws Exception {
  super.setUp();
  this.notIncludeAggr=false;
  this.add_subquery_on_query=false;
  this.USE_ROW_IN_AGGREGATION=false;
  this.GEN_queryResultID=null;
  this.UPDATE_queryResultID=null;
  this.USE_DATE_IN_COLUMNBINDING=true;
  this.GEN_add_subquery=false;
  this.GEN_add_sort=true;
  this.GEN_add_filter=false;
  this.GEN_add_group=false;
  this.GEN_print=false;
  this.GEN_use_invalid_column=false;
  this.UPDATE_add_filter=-1;
  this.UPDATE_add_sort=false;
  this.UPDATE_add_diff_group=false;
  this.UPDATE_add_same_group=false;
  this.UPDATE_add_subquery=0;
  this.USE_DATE_IN_SUBQUERY=false;
  this.PRE_add_filter=-1;
  this.PRE_add_sort=false;
  this.PRE_execute_query=false;
  this.PRE_print_groupinfo=false;
  this.PRE_use_skipto=false;
  this.PRE_use_skipto_num=-1;
  this.PRE_add_group=-1;
  this.PRE_basedon_genfilter=false;
  this.GEN_filterDefn=new ArrayList();
  this.UPDATE_filterDefn=new ArrayList();
  this.TEST_ISEMPTY=false;
  TimeZone.setDefault(TimeZone.getTimeZone("String_Node_Str"));
}

Fixed version (ground truth):
public void setUp() throws Exception {
  super.setUp();
  this.notIncludeAggr=false;
  this.add_subquery_on_query=false;
  this.USE_ROW_IN_AGGREGATION=false;
  this.GEN_queryResultID=null;
  this.UPDATE_queryResultID=null;
  this.USE_DATE_IN_COLUMNBINDING=true;
  this.GEN_add_subquery=false;
  this.GEN_add_sort=true;
  this.GEN_add_filter=false;
  this.GEN_add_group=false;
  this.GEN_print=false;
  this.GEN_USE_RUNNING_AGGR=false;
  this.GEN_use_invalid_column=false;
  this.UPDATE_add_filter=-1;
  this.UPDATE_add_sort=false;
  this.UPDATE_add_diff_group=false;
  this.UPDATE_add_same_group=false;
  this.UPDATE_add_subquery=0;
  this.USE_DATE_IN_SUBQUERY=false;
  this.PRE_add_filter=-1;
  this.PRE_add_sort=false;
  this.PRE_execute_query=false;
  this.PRE_print_groupinfo=false;
  this.PRE_use_skipto=false;
  this.PRE_use_skipto_num=-1;
  this.PRE_add_group=-1;
  this.PRE_basedon_genfilter=false;
  this.GEN_filterDefn=new ArrayList();
  this.UPDATE_filterDefn=new ArrayList();
  this.TEST_ISEMPTY=false;
  TimeZone.setDefault(TimeZone.getTimeZone("String_Node_Str"));
}
Program: 69651
Project: 69651
Buggy source:
/** 
 * @param qd1
 * @param rowBeArray
 * @param totalBeArray
 */
private void populateColumnBinding(QueryDefinition qd1,IBaseExpression[] rowBeArray,IBaseExpression[] totalBeArray){
  for (int i=0; i < rowBeArray.length; i++)   qd1.addResultSetExpression(this.rowExprName[i],rowBeArray[i]);
  for (int i=0; i < totalBeArray.length; i++)   qd1.addResultSetExpression(this.totalExprName[i],totalBeArray[i]);
}

Fixed version (ground truth):
/** 
 * @param qd1
 * @param rowBeArray
 * @param totalBeArray
 * @throws DataException 
 */
private void populateColumnBinding(QueryDefinition qd1,IBaseExpression[] rowBeArray,IBinding[] totalBeArray) throws DataException {
  for (int i=0; i < rowBeArray.length; i++)   qd1.addResultSetExpression(this.rowExprName[i],rowBeArray[i]);
  for (int i=0; i < totalBeArray.length; i++)   qd1.addBinding(totalBeArray[i]);
}
Program: 69652
Project: 69652
Buggy source:
/** 
 * @return aggregation expression array
 */
private IBaseExpression[] getAggrExpr(){
  if (this.notIncludeAggr)   return new IBaseExpression[0];
  int num2=2;
  IBaseExpression[] totalBeArray=new IBaseExpression[num2];
  totalBeArray[0]=new ScriptExpression("String_Node_Str");
  if (this.USE_ROW_IN_AGGREGATION)   totalBeArray[1]=new ScriptExpression("String_Node_Str");
 else   totalBeArray[1]=new ScriptExpression("String_Node_Str");
  totalExprName=new String[totalBeArray.length];
  this.totalExprName[0]="String_Node_Str";
  this.totalExprName[1]="String_Node_Str";
  return totalBeArray;
}

Fixed version (ground truth):
/** 
 * @return aggregation expression array
 * @throws DataException 
 */
private IBinding[] getAggrExpr() throws DataException {
  if (this.notIncludeAggr)   return new IBinding[0];
  totalExprName=new String[2];
  this.totalExprName[0]="String_Node_Str";
  this.totalExprName[1]="String_Node_Str";
  int num2=2;
  IBinding[] totalBeArray=new IBinding[num2];
  totalBeArray[0]=new Binding(this.totalExprName[0],new ScriptExpression(null));
  if (this.GEN_USE_RUNNING_AGGR)   totalBeArray[0].setAggrFunction("String_Node_Str");
 else   totalBeArray[0].setAggrFunction("String_Node_Str");
  if (this.USE_ROW_IN_AGGREGATION) {
    totalBeArray[1]=new Binding(this.totalExprName[1],new ScriptExpression("String_Node_Str"));
  }
 else {
    totalBeArray[1]=new Binding(this.totalExprName[1],new ScriptExpression("String_Node_Str"));
  }
  if (this.GEN_USE_RUNNING_AGGR)   totalBeArray[1].setAggrFunction("String_Node_Str");
 else   totalBeArray[1].setAggrFunction("String_Node_Str");
  return totalBeArray;
}
Program: 69657
Project: 69657
Buggy source:
public Object load(){
  if (input == null)   return "String_Node_Str";
  DesignElementHandle handle=(DesignElementHandle)DEUtil.getInputFirstElement(input);
  if (handle.getExtends() == null)   return "String_Node_Str";
  try {
    String filePath=DEUtil.getFilePathFormURL(new URL(handle.getExtends().getRoot().getFileName()));
    if (filePath != null) {
      File libraryFile=new File(filePath);
      if (libraryFile.exists())       return libraryFile.getAbsolutePath();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.handle(e);
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public Object load(){
  if (input == null)   return "String_Node_Str";
  DesignElementHandle handle=(DesignElementHandle)DEUtil.getInputFirstElement(input);
  if (handle.getExtends() == null)   return "String_Node_Str";
  String filePath=null;
  try {
    filePath=DEUtil.getFilePathFormURL(new URL(handle.getExtends().getRoot().getFileName()));
  }
 catch (  Exception e) {
    filePath=handle.getExtends().getRoot().getFileName();
  }
  if (filePath != null) {
    File libraryFile=new File(filePath);
    if (libraryFile.exists())     return libraryFile.getAbsolutePath();
  }
  return "String_Node_Str";
}
Program: 69658
Project: 69658
Buggy source:
/** 
 * @return
 * @throws DataException
 */
private IQueryDefinition createScriptDataSetQuery() throws DataException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName("String_Node_Str");
  query.addBinding(new Binding("String_Node_Str",new ScriptExpression("String_Node_Str")));
  return query;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException
 */
private IQueryDefinition createScriptDataSetQuery() throws DataException {
  QueryDefinition query=new QueryDefinition();
  query.setDataSetName("String_Node_Str");
  query.addBinding(new Binding("String_Node_Str",new ScriptExpression("String_Node_Str")));
  query.addBinding(new Binding("String_Node_Str",new ScriptExpression("String_Node_Str")));
  return query;
}
Program: 69659
Project: 69659
Buggy source:
void mouseDown(MouseEvent e){
  if (e.widget.equals(cnvMarkers)) {
    int ix=e.x / MARKER_BLOCK_WIDTH;
    int iy=e.y / MARKER_BLOCK_HEIGHT + iStartRow;
    iSelectedIndex=iy * MARKER_ROW_MAX_NUMBER + ix;
    if (ix >= MARKER_ROW_MAX_NUMBER || iSelectedIndex >= getMarkers().size()) {
      return;
    }
    this.cnvMarkers.redraw();
    setEnabledState();
  }
}

Fixed version (ground truth):
void mouseDown(MouseEvent e){
  if (e.widget.equals(cnvMarkers)) {
    int ix=e.x / MARKER_BLOCK_WIDTH;
    int iy=e.y / MARKER_BLOCK_HEIGHT + iStartRow;
    int clickIndex=iy * MARKER_ROW_MAX_NUMBER + ix;
    if (ix >= MARKER_ROW_MAX_NUMBER || clickIndex >= getMarkers().size()) {
      return;
    }
    iSelectedIndex=clickIndex;
    this.cnvMarkers.redraw();
    setEnabledState();
  }
}
Program: 69660
Project: 69660
Buggy source:
/** 
 * Updates the event by given LabelBlock object.
 */
public final String updateFrom(LabelBlock lb,double dScale,RunTimeContext rtc){
  final String sPreviousValue=lb.getLabel().getCaption().getValue();
  lb.getLabel().getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  setLabel(lb.getLabel());
  Bounds bo=goFactory.scaleBounds(lb.getBounds(),dScale);
  bo.adjust(goFactory.scaleInsets(lb.getInsets(),dScale));
  setBlockBounds(bo);
  setBlockAlignment(lb.getLabel().getCaption().getFont().getAlignment());
  setAction(TextRenderEvent.RENDER_TEXT_IN_BLOCK);
  return sPreviousValue;
}

Fixed version (ground truth):
/** 
 * Updates the event by given LabelBlock object.
 */
public final void updateFrom(LabelBlock lb,double dScale,RunTimeContext rtc){
  setLabel(lb.getLabel());
  Bounds bo=goFactory.scaleBounds(lb.getBounds(),dScale);
  bo.adjust(goFactory.scaleInsets(lb.getInsets(),dScale));
  setBlockBounds(bo);
  setBlockAlignment(lb.getLabel().getCaption().getFont().getAlignment());
  setAction(TextRenderEvent.RENDER_TEXT_IN_BLOCK);
}
Program: 69661
Project: 69661
Buggy source:
protected BoundingBox computeBox(IDisplayServer xs,RunTimeContext rtc) throws ChartException {
  Label la=goFactory.copyOf(getLabel());
  final String sPreviousValue=la.getCaption().getValue();
  la.getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  la.setEllipsis(1);
  Map<Label,LabelLimiter> mapLimiter=rtc.getState(RunTimeContext.StateKey.LABEL_LIMITER_LOOKUP_KEY);
  LabelLimiter lbLimiter=mapLimiter.get(getLabel());
  lbLimiter.computeWrapping(xs,la);
  int iTitileAnchor=getAnchor().getValue();
  EnumSet<LabelLimiter.Option> option=iTitileAnchor == Anchor.EAST || iTitileAnchor == Anchor.WEST ? EnumSet.of(LabelLimiter.Option.FIX_HEIGHT) : EnumSet.of(LabelLimiter.Option.FIX_WIDTH);
  IChartComputation cComp=rtc.getState(StateKey.CHART_COMPUTATION_KEY);
  LabelLimiter lbLimiterNew=lbLimiter.limitLabelSize(cComp,xs,la,option);
  mapLimiter.put(getLabel(),lbLimiterNew);
  return lbLimiterNew.getBounding(null);
}

Fixed version (ground truth):
protected BoundingBox computeBox(IDisplayServer xs,RunTimeContext rtc) throws ChartException {
  Label la=goFactory.copyOf(getLabel());
  final String sPreviousValue=la.getCaption().getValue();
  la.getCaption().setValue(rtc.externalizedMessage(sPreviousValue));
  la.setEllipsis(1);
  Map<Label,LabelLimiter> mapLimiter=rtc.getState(RunTimeContext.StateKey.LABEL_LIMITER_LOOKUP_KEY);
  LabelLimiter lbLimiter=mapLimiter.get(getLabel());
  lbLimiter.computeWrapping(xs,la);
  IChartComputation cComp=rtc.getState(StateKey.CHART_COMPUTATION_KEY);
  LabelLimiter lbLimiterNew=lbLimiter.limitLabelSize(cComp,xs,la);
  mapLimiter.put(getLabel(),lbLimiterNew);
  return lbLimiterNew.getBounding(null);
}
Program: 69664
Project: 69664
Buggy source:
void removeDimension(DimensionViewHandle dimensionView,boolean needTransaction) throws SemanticException {
  if (dimensionView == null || dimensionView.getContainer() != crosstabView)   return;
  CommandStack stack=null;
  if (needTransaction) {
    stack=crosstabView.getCommandStack();
    stack.startTrans(Messages.getString("String_Node_Str"));
  }
  int count=dimensionView.getLevelCount();
  try {
    if (crosstab != null) {
      DimensionViewTask dimTask=new DimensionViewTask(dimensionView);
      for (int i=0; i < count; i++) {
        LevelViewHandle lv=dimensionView.getLevel(0);
        if (lv != null) {
          dimTask.removeLevel(lv,false);
        }
      }
    }
    dimensionView.getModelHandle().drop();
    if (crosstabView.getDimensionCount() == 0) {
      removeGrandTotal(false);
    }
  }
 catch (  SemanticException e) {
    if (needTransaction) {
      stack.rollback();
    }
    throw e;
  }
  if (needTransaction) {
    stack.commit();
  }
}

Fixed version (ground truth):
void removeDimension(DimensionViewHandle dimensionView,boolean needTransaction) throws SemanticException {
  if (dimensionView == null || dimensionView.getContainer() != crosstabView)   return;
  CommandStack stack=null;
  if (needTransaction) {
    stack=crosstabView.getCommandStack();
    stack.startTrans(Messages.getString("String_Node_Str"));
  }
  int count=dimensionView.getLevelCount();
  try {
    if (crosstabView.getDimensionCount() == 1) {
      removeGrandTotal(false);
    }
    if (crosstab != null) {
      DimensionViewTask dimTask=new DimensionViewTask(dimensionView);
      for (int i=0; i < count; i++) {
        LevelViewHandle lv=dimensionView.getLevel(0);
        if (lv != null) {
          dimTask.removeLevel(lv,false);
        }
      }
    }
    dimensionView.getModelHandle().drop();
  }
 catch (  SemanticException e) {
    if (needTransaction) {
      stack.rollback();
    }
    throw e;
  }
  if (needTransaction) {
    stack.commit();
  }
}
Program: 69666
Project: 69666
Buggy source:
public Object getLevelAttributeValue(String dimensionName,String levelName,String attributeName) throws DataException, IOException {
  int dimensionIndex=getDimensionIndex(dimensionName);
  if (dimensionIndex < 0) {
    return null;
  }
  Member member;
  try {
    member=getLevelMember(dimensionIndex,levelName);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  int attributeIndex=allCubeDimensionResultIterators[dimensionIndex].getLevelAttributeIndex(levelName,attributeName);
  if (member != null && attributeIndex >= 0)   return member.getAttributes()[attributeIndex];
  return null;
}

Fixed version (ground truth):
public Object getLevelAttributeValue(String dimensionName,String levelName,String attributeName) throws DataException, IOException {
  int dimensionIndex=getDimensionIndex(dimensionName);
  if (dimensionIndex < 0) {
    return null;
  }
  Member member;
  try {
    member=getLevelMember(dimensionIndex,levelName);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  checkAndInitDimIterator(dimensionIndex);
  int attributeIndex=allCubeDimensionResultIterators[dimensionIndex].getLevelAttributeIndex(levelName,attributeName);
  if (member != null && attributeIndex >= 0)   return member.getAttributes()[attributeIndex];
  return null;
}
Program: 69667
Project: 69667
Buggy source:
/** 
 * @param factTable
 * @param dimensionName
 * @param dimensionPos
 * @param stopSign
 * @throws IOException
 */
public FactTableRowIterator(FactTable factTable,String[] dimensionName,IDiskArray[] dimensionPos,IDimensionResultIterator[] allCubeDimensionResultIterators,IComputedMeasureHelper computedMeasureHelper,StopSign stopSign) throws IOException {
}

Fixed version (ground truth):
/** 
 * @param factTable
 * @param dimensionName
 * @param dimensionPos
 * @param stopSign
 * @throws IOException
 */
public FactTableRowIterator(FactTable factTable,String[] dimensionName,IDiskArray[] dimensionPos,IDimension[] allCubeDimensions,IComputedMeasureHelper computedMeasureHelper,StopSign stopSign) throws IOException {
}
Program: 69668
Project: 69668
Buggy source:
/** 
 * @param iteratorIndex
 * @param levelIndex
 * @param dimensionPosition
 * @return
 * @throws BirtException
 * @throws IOException
 */
private Member getLevelObject(int dimIndex,int levelIndex,int dimensionPosition) throws BirtException, IOException {
  allCubeDimensionResultIterators[dimIndex].seek(dimensionPosition);
  return allCubeDimensionResultIterators[dimIndex].getLevelMember(levelIndex);
}

Fixed version (ground truth):
/** 
 * @param iteratorIndex
 * @param levelIndex
 * @param dimensionPosition
 * @return
 * @throws BirtException
 * @throws IOException
 */
private Member getLevelObject(int dimIndex,int levelIndex,int dimensionPosition) throws BirtException, IOException {
  checkAndInitDimIterator(dimIndex);
  allCubeDimensionResultIterators[dimIndex].seek(dimensionPosition);
  return allCubeDimensionResultIterators[dimIndex].getLevelMember(levelIndex);
}
Program: 69669
Project: 69669
Buggy source:
private Member getLevelMember(int dimIndex,String levelName) throws BirtException, IOException {
  int levelIndex=-1;
  if (dimIndex >= 0) {
    IDimensionResultIterator itr=allCubeDimensionResultIterators[dimIndex];
    levelIndex=itr.getLevelIndex(levelName);
    if (levelIndex >= 0)     return getMember(dimIndex,levelIndex);
  }
  return null;
}

Fixed version (ground truth):
private Member getLevelMember(int dimIndex,String levelName) throws BirtException, IOException {
  int levelIndex=-1;
  if (dimIndex >= 0) {
    checkAndInitDimIterator(dimIndex);
    IDimensionResultIterator itr=allCubeDimensionResultIterators[dimIndex];
    levelIndex=itr.getLevelIndex(levelName);
    if (levelIndex >= 0)     return getMember(dimIndex,levelIndex);
  }
  return null;
}
Program: 69671
Project: 69671
Buggy source:
protected boolean refresh(){
  if (isPreviewing)   return false;
  isPreviewing=true;
  ModuleHandle model=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (!UIUtil.canPreviewWithErrors(model)) {
    isPreviewing=false;
    return false;
  }
  boolean isDisplay=false;
  if (isMissingParameter()) {
    if (parameterDialog != null) {
      parameterDialog.open();
      if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
        isDisplay=true;
        if (isMissingParameter()) {
          return false;
        }
      }
    }
  }
 else {
    isDisplay=true;
  }
  if (isDisplay) {
    display();
  }
  ReportRequest request=new ReportRequest(ReportPreviewFormPage.this);
  List list=new ArrayList();
  list.add(new Object());
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  isPreviewing=false;
  return true;
}

Fixed version (ground truth):
protected boolean refresh(){
  if (isPreviewing)   return false;
  isPreviewing=true;
  ModuleHandle model=SessionHandleAdapter.getInstance().getReportDesignHandle();
  if (!UIUtil.canPreviewWithErrors(model)) {
    isPreviewing=false;
    return false;
  }
  boolean isDisplay=false;
  showProgress();
  if (isMissingParameter()) {
    if (parameterDialog != null) {
      parameterDialog.open();
      if (parameterDialog.getReturnCode() == InputParameterHtmlDialog.RETURN_CODE_BROWSER_CLOSED) {
        isDisplay=true;
        if (isMissingParameter()) {
          return false;
        }
      }
 else {
        hideProgress();
      }
    }
  }
 else {
    isDisplay=true;
  }
  if (isDisplay) {
    display();
  }
  ReportRequest request=new ReportRequest(ReportPreviewFormPage.this);
  List list=new ArrayList();
  list.add(new Object());
  request.setSelectionObject(list);
  request.setType(ReportRequest.SELECTION);
  SessionHandleAdapter.getInstance().getMediator().notifyRequest(request);
  isPreviewing=false;
  return true;
}
Program: 69672
Project: 69672
Buggy source:
/** 
 * @return true if BIRT render the report page by page. false if BIRTrender the report as a whole page.
 */
protected boolean needPagedExecutor(List<long[]> pageSequences){
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    if (pageSequences == null) {
      return false;
    }
    if (pageSequences != null && pageSequences.size() == 1) {
      long[] pages=pageSequences.get(0);
      if (pages[0] == 1) {
        return false;
      }
    }
    return true;
  }
  int pageCount=getPageCount();
  if (pageCount == 1) {
    return true;
  }
  IRenderOption renderOption=executionContext.getRenderOption();
  HTMLRenderOption htmlRenderOption=new HTMLRenderOption(renderOption);
  boolean htmlPagination=htmlRenderOption.getHtmlPagination();
  if (!htmlPagination) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @return true if BIRT render the report page by page. false if BIRTrender the report as a whole page.
 */
protected boolean needPagedExecutor(List<long[]> pageSequences){
  if (ExtensionManager.PAPER_SIZE_PAGINATION.equals(pagination)) {
    if (pageSequences == null) {
      return false;
    }
    if (pageSequences != null && pageSequences.size() == 1) {
      long[] pages=pageSequences.get(0);
      if (pages[0] == 1 && pages[1] == reportDocument.getPageCount()) {
        return false;
      }
    }
    return true;
  }
  int pageCount=getPageCount();
  if (pageCount == 1) {
    return true;
  }
  IRenderOption renderOption=executionContext.getRenderOption();
  HTMLRenderOption htmlRenderOption=new HTMLRenderOption(renderOption);
  boolean htmlPagination=htmlRenderOption.getHtmlPagination();
  if (!htmlPagination) {
    return false;
  }
  return true;
}
Program: 69674
Project: 69674
Buggy source:
private SheetData createImageData(IImageContent image,StyleEntry entry,XlsContainer container){
  int type=SheetData.IMAGE;
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Integer.toString(type));
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (null == altText) {
      altText=messageFlashObjectNotSupported;
    }
    return createData(altText,entry);
  }
  Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
  byte[] data=imageInfo.getData();
  if (data != null) {
    return new ImageData(image,entry,type,imageInfo,container);
  }
 else {
    return createData(image.getAltText(),entry);
  }
}

Fixed version (ground truth):
private SheetData createImageData(IImageContent image,StyleEntry entry,XlsContainer container){
  int type=SheetData.IMAGE;
  entry.setProperty(StyleConstant.DATA_TYPE_PROP,Integer.toString(type));
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (null == altText) {
      altText=messageFlashObjectNotSupported;
    }
    return createData(altText,entry);
  }
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),image.getURI(),image.getMIMEType(),image.getExtension());
    byte[] data=imageInfo.getData();
    if (data != null) {
      return new ImageData(image,entry,type,imageInfo,container);
    }
 else {
      return createData(image.getAltText(),entry);
    }
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
    return createData(image.getAltText(),entry);
  }
}
Program: 69675
Project: 69675
Buggy source:
public void startImage(IImageContent image){
  IStyle style=image.getComputedStyle();
  InlineFlag inlineFlag=getInlineFlag(style);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  context.addContainer(false);
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (altText == null) {
      altText=messageFlashObjectNotSupported;
    }
    wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
    return;
  }
  Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),uri,mimeType,extension);
  byte[] data=imageInfo.getData();
  if (data == null || data.length == 0) {
    wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
    return;
  }
  double height=WordUtil.convertImageSize(image.getHeight(),imageInfo.getHeight());
  double width=WordUtil.convertImageSize(image.getWidth(),imageInfo.getWidth());
  writeBookmark(image);
  writeToc(image);
  HyperlinkInfo hyper=getHyperlink(image);
  wordWriter.drawImage(data,height,width,hyper,style,inlineFlag,altText,uri);
}

Fixed version (ground truth):
public void startImage(IImageContent image){
  IStyle style=image.getComputedStyle();
  InlineFlag inlineFlag=getInlineFlag(style);
  String uri=image.getURI();
  String mimeType=image.getMIMEType();
  String extension=image.getExtension();
  String altText=image.getAltText();
  context.addContainer(false);
  if (FlashFile.isFlash(mimeType,uri,extension)) {
    if (altText == null) {
      altText=messageFlashObjectNotSupported;
    }
    wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
    return;
  }
  try {
    Image imageInfo=EmitterUtil.parseImage(image,image.getImageSource(),uri,mimeType,extension);
    byte[] data=imageInfo.getData();
    if (data == null || data.length == 0) {
      wordWriter.drawImage(null,0.0,0.0,null,style,inlineFlag,altText,uri);
      return;
    }
    double height=WordUtil.convertImageSize(image.getHeight(),imageInfo.getHeight());
    double width=WordUtil.convertImageSize(image.getWidth(),imageInfo.getWidth());
    writeBookmark(image);
    writeToc(image);
    HyperlinkInfo hyper=getHyperlink(image);
    wordWriter.drawImage(data,height,width,hyper,style,inlineFlag,altText,uri);
  }
 catch (  IOException e) {
    logger.log(Level.WARNING,e.getLocalizedMessage());
  }
}
Program: 69676
Project: 69676
Buggy source:
public void drawDocumentBackground(String bgcolor,String backgroundImageUrl,String backgroundHeight,String backgroundWidth){
  writer.openTag("String_Node_Str");
  if (backgroundImageUrl != null && backgroundHeight == null && backgroundWidth == null) {
    byte[] backgroundImageData=EmitterUtil.getImageData(backgroundImageUrl);
    drawDocumentBackgroundImage(backgroundImageData);
  }
 else   drawDocumentBackgroundColor(bgcolor);
  writer.closeTag("String_Node_Str");
}

Fixed version (ground truth):
public void drawDocumentBackground(String bgcolor,String backgroundImageUrl,String backgroundHeight,String backgroundWidth){
  writer.openTag("String_Node_Str");
  if (backgroundImageUrl != null && backgroundHeight == null && backgroundWidth == null) {
    try {
      byte[] backgroundImageData=EmitterUtil.getImageData(backgroundImageUrl);
      drawDocumentBackgroundImage(backgroundImageData);
    }
 catch (    IOException e) {
      logger.log(Level.WARNING,e.getLocalizedMessage());
    }
  }
 else   drawDocumentBackgroundColor(bgcolor);
  writer.closeTag("String_Node_Str");
}
Program: 69677
Project: 69677
Buggy source:
public static byte[] getImageData(String imageURI){
  byte[] imageData=null;
  if (SvgFile.isSvg(imageURI)) {
    try {
      imageData=SvgFile.transSvgToArray(imageURI);
    }
 catch (    IOException e) {
      logger.log(Level.WARNING,e.getMessage(),e);
    }
  }
 else {
    imageData=getNonSVGImageData(imageURI);
  }
  return imageData;
}

Fixed version (ground truth):
public static byte[] getImageData(String imageURI) throws IOException {
  byte[] imageData=null;
  if (SvgFile.isSvg(imageURI)) {
    imageData=SvgFile.transSvgToArray(imageURI);
  }
 else {
    imageData=getNonSVGImageData(imageURI);
  }
  return imageData;
}
Program: 69678
Project: 69678
Buggy source:
private static byte[] getNonSVGImageData(String imageURI){
  InputStream imageStream=null;
  byte[] imageData;
  try {
    URL url=new URL(imageURI);
    imageStream=url.openStream();
    imageData=readData(imageStream);
  }
 catch (  IOException ioe) {
    logger.log(Level.WARNING,ioe.getMessage(),ioe);
    imageData=null;
  }
 finally {
    if (imageStream != null) {
      try {
        imageStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return imageData;
}

Fixed version (ground truth):
private static byte[] getNonSVGImageData(String imageURI) throws IOException {
  InputStream imageStream=null;
  byte[] imageData;
  try {
    URL url=new URL(imageURI);
    imageStream=url.openStream();
    imageData=readData(imageStream);
  }
  finally {
    if (imageStream != null) {
      try {
        imageStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return imageData;
}
Program: 69679
Project: 69679
Buggy source:
public static org.eclipse.birt.report.engine.layout.emitter.Image parseImage(IImageContent image,int imageSource,String uri,String mimeType,String extension){
  org.eclipse.birt.report.engine.layout.emitter.Image imageInfo=null;
  byte[] data=null;
  InputStream in=null;
  try {
switch (imageSource) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
      if (uri != null) {
        if (SvgFile.isSvg(uri)) {
          data=SvgFile.transSvgToArray(uri);
        }
 else {
          data=getNonSVGImageData(uri);
        }
      }
    break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
  data=image.getData();
if (SvgFile.isSvg(mimeType,uri,extension) && null != data) {
  in=new ByteArrayInputStream(data);
  data=SvgFile.transSvgToArray(in);
}
break;
}
imageInfo=new org.eclipse.birt.report.engine.layout.emitter.Image();
if (data != null) {
imageInfo.setInput(data);
if (!imageInfo.check()) {
imageInfo.setData(null);
}
}
}
 catch (Exception e) {
logger.log(Level.WARNING,e.getMessage(),e);
}
 finally {
if (in != null) {
try {
in.close();
in=null;
}
 catch (Exception t) {
logger.log(Level.WARNING,t.getMessage());
}
}
}
return imageInfo;
}

Fixed version (ground truth):
public static org.eclipse.birt.report.engine.layout.emitter.Image parseImage(IImageContent image,int imageSource,String uri,String mimeType,String extension) throws IOException {
  org.eclipse.birt.report.engine.layout.emitter.Image imageInfo=null;
  byte[] data=null;
  InputStream in=null;
  try {
switch (imageSource) {
case IImageContent.IMAGE_FILE:
case IImageContent.IMAGE_URL:
      if (uri != null) {
        if (SvgFile.isSvg(uri)) {
          data=SvgFile.transSvgToArray(uri);
        }
 else {
          data=getNonSVGImageData(uri);
        }
      }
    break;
case IImageContent.IMAGE_NAME:
case IImageContent.IMAGE_EXPRESSION:
  data=image.getData();
if (SvgFile.isSvg(mimeType,uri,extension) && null != data) {
  in=new ByteArrayInputStream(data);
  data=SvgFile.transSvgToArray(in);
}
break;
}
imageInfo=new org.eclipse.birt.report.engine.layout.emitter.Image();
if (data != null) {
imageInfo.setInput(data);
if (!imageInfo.check()) {
imageInfo.setData(null);
}
}
}
  finally {
if (in != null) {
try {
in.close();
in=null;
}
 catch (Exception t) {
logger.log(Level.WARNING,t.getMessage());
}
}
}
return imageInfo;
}
Program: 69680
Project: 69680
Buggy source:
/** 
 * @param expList
 * @param uv
 */
private void getURLValueExpressions(List<String> expList,URLValue uv){
  String sa=uv.getBaseUrl();
  try {
    ActionHandle handle=ModuleUtil.deserializeAction(sa);
    String exp;
    if (DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK.equals(handle.getLinkType())) {
      exp=handle.getURI();
      if (!expList.contains(exp)) {
        expList.add(exp);
      }
    }
 else     if (DesignChoiceConstants.ACTION_LINK_TYPE_BOOKMARK_LINK.equals(handle.getLinkType())) {
      exp=handle.getTargetBookmark();
      if (!expList.contains(exp)) {
        expList.add(exp);
      }
    }
 else     if (DesignChoiceConstants.ACTION_LINK_TYPE_DRILL_THROUGH.equals(handle.getLinkType())) {
      exp=handle.getTargetBookmark();
      if (exp != null && !expList.contains(exp)) {
        expList.add(exp);
      }
      for (Iterator itr=handle.getSearch().iterator(); itr.hasNext(); ) {
        SearchKeyHandle skh=(SearchKeyHandle)itr.next();
        exp=skh.getExpression();
        if (!expList.contains(exp)) {
          expList.add(exp);
        }
      }
      for (Iterator itr=handle.getParamBindings().iterator(); itr.hasNext(); ) {
        ParamBindingHandle pbh=(ParamBindingHandle)itr.next();
        exp=pbh.getExpression();
        if (!expList.contains(exp)) {
          expList.add(exp);
        }
      }
    }
  }
 catch (  DesignFileException e) {
    logger.log(e);
  }
}

Fixed version (ground truth):
/** 
 * @param expList
 * @param uv
 */
private void getURLValueExpressions(List<String> expList,URLValue uv){
  String sa=uv.getBaseUrl();
  try {
    ActionHandle handle=ModuleUtil.deserializeAction(sa);
    String exp;
    if (DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK.equals(handle.getLinkType())) {
      ExpressionHandle expHandle=handle.getExpressionProperty(org.eclipse.birt.report.model.api.elements.structures.Action.URI_MEMBER);
      if (ExpressionType.JAVASCRIPT.equals(expHandle.getType())) {
        exp=expHandle.getStringExpression();
        if (!expList.contains(exp)) {
          expList.add(exp);
        }
      }
    }
 else     if (DesignChoiceConstants.ACTION_LINK_TYPE_BOOKMARK_LINK.equals(handle.getLinkType())) {
      exp=handle.getTargetBookmark();
      if (!expList.contains(exp)) {
        expList.add(exp);
      }
    }
 else     if (DesignChoiceConstants.ACTION_LINK_TYPE_DRILL_THROUGH.equals(handle.getLinkType())) {
      exp=handle.getTargetBookmark();
      if (exp != null && !expList.contains(exp)) {
        expList.add(exp);
      }
      for (Iterator itr=handle.getSearch().iterator(); itr.hasNext(); ) {
        SearchKeyHandle skh=(SearchKeyHandle)itr.next();
        exp=skh.getExpression();
        if (!expList.contains(exp)) {
          expList.add(exp);
        }
      }
      for (Iterator itr=handle.getParamBindings().iterator(); itr.hasNext(); ) {
        ParamBindingHandle pbh=(ParamBindingHandle)itr.next();
        exp=pbh.getExpression();
        if (!expList.contains(exp)) {
          expList.add(exp);
        }
      }
    }
  }
 catch (  DesignFileException e) {
    logger.log(e);
  }
}
Program: 69681
Project: 69681
Buggy source:
protected String getActionString(ChartHyperlinkActionBase chAction,ActionHandle handle){
  if (DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK.equals(handle.getLinkType()))   return ChartUtil.stringValue(chAction.evaluate(handle.getURI()));
  if (DesignChoiceConstants.ACTION_LINK_TYPE_BOOKMARK_LINK.equals(handle.getLinkType()))   return ChartUtil.stringValue(chAction.evaluate(handle.getTargetBookmark()));
  return null;
}

Fixed version (ground truth):
protected String getActionString(ChartHyperlinkActionBase chAction,ActionHandle handle){
  if (DesignChoiceConstants.ACTION_LINK_TYPE_HYPERLINK.equals(handle.getLinkType())) {
    ExpressionHandle urlExpr=handle.getExpressionProperty(org.eclipse.birt.report.model.api.elements.structures.Action.URI_MEMBER);
    String text=urlExpr.getStringExpression();
    if (ExpressionType.CONSTANT.equals(urlExpr.getType())) {
      return text;
    }
 else {
      return ChartUtil.stringValue(chAction.evaluate(text));
    }
  }
  if (DesignChoiceConstants.ACTION_LINK_TYPE_BOOKMARK_LINK.equals(handle.getLinkType()))   return ChartUtil.stringValue(chAction.evaluate(handle.getTargetBookmark()));
  return null;
}