nus-yam/ex-repair huggingface dataset:
Program: 74956
Project: 74956
Buggy source:
/** 
 * @throws DataException
 */
public void test_BETWEEN() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr(new Integer(10),IConditionalExpression.OP_BETWEEN,new Double(9.9),new BigDecimal(19.9));
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(new Integer(10),IConditionalExpression.OP_BETWEEN,new Double(10.9),new BigDecimal(19.9));
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(new Integer(10),IConditionalExpression.OP_BETWEEN,new Double(20),new BigDecimal(9.9));
  assertResult(result,true);
  GregorianCalendar calendar=new GregorianCalendar(2001,11 - 1,1);
  result=ScriptEvalUtil.evalConditionalExpr(calendar.getTime(),IConditionalExpression.OP_BETWEEN,"String_Node_Str","String_Node_Str");
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(new Double(10),IConditionalExpression.OP_BETWEEN,new Double(9),new Integer(20));
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_BETWEEN,new Integer(9),new Double(20.0));
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(calendar.getTime(),IConditionalExpression.OP_BETWEEN,ExprTextAndValue.newInstance("String_Node_Str","String_Node_Str"),ExprTextAndValue.newInstance("String_Node_Str",new Double(0.25)));
  assertResult(result,false);
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
public void test_BETWEEN() throws DataException {
  Object result;
  result=ScriptEvalUtil.evalConditionalExpr(new Integer(10),IConditionalExpression.OP_BETWEEN,new Double(9.9),new BigDecimal(19.9));
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(new Integer(10),IConditionalExpression.OP_BETWEEN,new Double(10.9),new BigDecimal(19.9));
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(new Integer(10),IConditionalExpression.OP_BETWEEN,new Double(20),new BigDecimal(9.9));
  assertResult(result,true);
  GregorianCalendar calendar=new GregorianCalendar(2001,11 - 1,1);
  result=ScriptEvalUtil.evalConditionalExpr(calendar.getTime(),IConditionalExpression.OP_BETWEEN,"String_Node_Str","String_Node_Str");
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(new Double(10),IConditionalExpression.OP_BETWEEN,new Double(9),new Integer(20));
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr("String_Node_Str",IConditionalExpression.OP_BETWEEN,new Integer(9),new Double(20.0));
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(calendar.getTime(),IConditionalExpression.OP_BETWEEN,ExprTextAndValue.newInstance("String_Node_Str","String_Node_Str"),ExprTextAndValue.newInstance("String_Node_Str",new Double(0.25)));
  assertResult(result,false);
  result=ScriptEvalUtil.evalConditionalExpr(new Boolean(true),IConditionalExpression.OP_BETWEEN,new Double(0.5),new Double(2));
  assertResult(result,true);
  result=ScriptEvalUtil.evalConditionalExpr(new Boolean(true),IConditionalExpression.OP_BETWEEN,new Double(-1),new Double(0.5));
  assertResult(result,false);
}
Program: 74957
Project: 74957
Buggy source:
/** 
 * To ease the methods compare and between. Exception with specific explanation will be thrown if anything goes wrong.
 * @param obj
 * @param op1
 * @param op2
 * @return
 * @throws DataException
 */
private static Object[] formatToComparable(Object obj,ExprTextAndValue op1,ExprTextAndValue op2) throws DataException {
  Object[] obArray=new Object[3];
  obArray[0]=obj;
  obArray[1]=op1.value;
  obArray[2]=op2.value;
  if (isSameType(obj,obArray[1])) {
    if (obArray[2] == null || (obArray[2] != null && isSameType(obj,obArray[2]))) {
      return obArray;
    }
  }
  try {
    if (obj instanceof Number) {
      obArray[0]=DataTypeUtil.toDouble(obj);
      obArray[1]=DataTypeUtil.toDouble(obArray[1]);
      if (obArray[2] != null) {
        obArray[2]=DataTypeUtil.toDouble(obArray[2]);
      }
    }
 else     if (obj instanceof java.sql.Date) {
      obArray[0]=DataTypeUtil.toSqlDate(obj);
      obArray[1]=DataTypeUtil.toSqlDate(obArray[1]);
      if (obArray[2] != null) {
        obArray[2]=DataTypeUtil.toSqlDate(obArray[2]);
      }
    }
 else     if (obj instanceof java.sql.Time) {
      obArray[0]=DataTypeUtil.toSqlTime(obj);
      obArray[1]=DataTypeUtil.toSqlTime(obArray[1]);
      if (obArray[2] != null) {
        obArray[2]=DataTypeUtil.toSqlTime(obArray[2]);
      }
    }
 else     if (obj instanceof Date) {
      obArray[0]=DataTypeUtil.toDate(obj);
      obArray[1]=DataTypeUtil.toDate(obArray[1]);
      if (obArray[2] != null) {
        obArray[2]=DataTypeUtil.toDate(obArray[2]);
      }
    }
 else     if (obj instanceof Boolean) {
      obArray[0]=DataTypeUtil.toBoolean(obj);
      obArray[1]=DataTypeUtil.toBoolean(obArray[1]);
    }
  }
 catch (  BirtException e) {
    try {
      makeObjectArrayStringArray(obArray);
    }
 catch (    BirtException e1) {
    }
  }
  return obArray;
}

Fixed version (ground truth):
/** 
 * To ease the methods compare and between. Exception with specific explanation will be thrown if anything goes wrong.
 * @param obj
 * @param op1
 * @param op2
 * @return
 * @throws DataException
 */
private static Object[] formatToComparable(Object obj,ExprTextAndValue op1,ExprTextAndValue op2) throws DataException {
  Object[] obArray=new Object[3];
  obArray[0]=obj;
  obArray[1]=op1.value;
  obArray[2]=op2.value;
  if (isSameType(obj,obArray[1])) {
    if (obArray[2] == null || (obArray[2] != null && isSameType(obj,obArray[2]))) {
      return obArray;
    }
  }
  if (obj instanceof Boolean)   populateObArray(obArray[1],obArray);
 else   populateObArray(obj,obArray);
  return obArray;
}
Program: 74959
Project: 74959
Buggy source:
protected void drawImage(String uri,String extension,float imageX,float imageY,float height,float width,String helpText) throws Exception {
  if (uri == null) {
    return;
  }
  byte[] imageData=null;
  InputStream imageStream=new URL(uri).openStream();
  imageData=new byte[imageStream.available()];
  imageStream.read(imageData);
  drawImage(imageData,extension,imageX,imageY,height,width,helpText);
}

Fixed version (ground truth):
protected void drawImage(String uri,String extension,float imageX,float imageY,float height,float width,String helpText) throws Exception {
  if (uri == null) {
    return;
  }
  InputStream imageStream=new URL(uri).openStream();
  int data;
  ByteArrayOutputStream byteArrayOut=new ByteArrayOutputStream();
  while ((data=imageStream.read()) != -1) {
    byteArrayOut.write(data);
  }
  drawImage(byteArrayOut.toByteArray(),extension,imageX,imageY,height,width,helpText);
}
Program: 74960
Project: 74960
Buggy source:
/** 
 * @param sash
 * @param parent
 * @param left
 * @param right
 */
private void addDragListerner(final Sash sash,final Composite parent,final Control left,final Control right){
  sash.addListener(SWT.Selection,new Listener(){
    public void handleEvent(    Event event){
      if (event.detail == SWT.DRAG) {
        return;
      }
      Sash sash=(Sash)event.widget;
      int shift=event.x - sash.getBounds().x;
      GridData data=(GridData)left.getLayoutData();
      int newWidthHint=data.widthHint + shift;
      if (newWidthHint < 0) {
        return;
      }
      Point computedSize=parent.computeSize(SWT.DEFAULT,SWT.DEFAULT);
      Point currentSize=parent.getSize();
      boolean customSize=!computedSize.equals(currentSize);
      data.widthHint=newWidthHint;
      data=(GridData)right.getLayoutData();
      newWidthHint=data.widthHint - shift;
      data.widthHint=newWidthHint;
      parent.layout(true);
      computedSize=parent.computeSize(SWT.DEFAULT,SWT.DEFAULT);
      if (customSize) {
        computedSize.x=Math.max(computedSize.x,currentSize.x);
      }
      computedSize.y=Math.max(computedSize.y,currentSize.y);
      if (computedSize.equals(currentSize)) {
        return;
      }
      parent.setSize(computedSize.x,computedSize.y);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param sash
 * @param parent
 * @param left
 * @param right
 */
private void addDragListerner(final Sash sash,final Composite parent,final Control left,final Control right){
  sash.addListener(SWT.Selection,new Listener(){
    public void handleEvent(    Event event){
      if (event.detail == SWT.DRAG) {
        return;
      }
      Sash sash=(Sash)event.widget;
      int shift=event.x - sash.getBounds().x;
      left.setSize(left.getSize().x + shift,left.getSize().y);
      right.setSize(right.getSize().x - shift,right.getSize().y);
      right.setLocation(right.getLocation().x + shift,right.getLocation().y);
      sash.setLocation(sash.getLocation().x + shift,sash.getLocation().y);
    }
  }
);
}
Program: 74961
Project: 74961
Buggy source:
private String applyIntrinsicFont(String fontName,int fontStyle,float fontSize,String text){
  setFont(fontName,fontSize);
  if (text.endsWith("String_Node_Str")) {
    text=text + "String_Node_Str";
  }
  text=text.replaceAll("String_Node_Str","String_Node_Str");
  return ("String_Node_Str" + text + "String_Node_Str");
}

Fixed version (ground truth):
private String applyIntrinsicFont(String fontName,int fontStyle,float fontSize,String text){
  setFont(fontName,fontSize);
  text=text.replaceAll("String_Node_Str","String_Node_Str");
  text=text.replaceAll("String_Node_Str","String_Node_Str");
  return ("String_Node_Str" + text + "String_Node_Str");
}
Program: 74963
Project: 74963
Buggy source:
private String applyIntrinsicFont(String fontName,int fontStyle,float fontSize,String text){
  setFont(fontName,fontSize);
  return ("String_Node_Str" + text + "String_Node_Str");
}

Fixed version (ground truth):
private String applyIntrinsicFont(String fontName,int fontStyle,float fontSize,String text){
  setFont(fontName,fontSize);
  if (text.endsWith("String_Node_Str")) {
    text=text + "String_Node_Str";
  }
  return ("String_Node_Str" + text + "String_Node_Str");
}
Program: 74964
Project: 74964
Buggy source:
public int canDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (!isDataColumn(transfer))   return DNDService.LOGIC_UNKNOW;
  DesignElementHandle handle=getExtendedItemHandle(target);
  if (handle != null) {
    if (handle.getProperty(IReportItemModel.CUBE_PROP) == null && (target instanceof CrosstabTableEditPart || target instanceof CrosstabCellEditPart)) {
      return DNDService.LOGIC_TRUE;
    }
 else     if (handle.getProperty(IReportItemModel.CUBE_PROP) != null) {
      Object model=((EditPart)target).getModel();
      if (model instanceof CrosstabCellAdapter) {
        PropertyHandle propertyHandle=((CrosstabCellAdapter)model).getPropertyHandle();
        if (propertyHandle != null && propertyHandle.canContain("String_Node_Str")) {
          return DNDService.LOGIC_TRUE;
        }
      }
    }
  }
  return DNDService.LOGIC_UNKNOW;
}

Fixed version (ground truth):
public int canDrop(Object transfer,Object target,int operation,DNDLocation location){
  if (!isDataColumn(transfer))   return DNDService.LOGIC_UNKNOW;
  DesignElementHandle handle=getExtendedItemHandle(target);
  if (handle != null) {
    if (handle.getProperty(IReportItemModel.CUBE_PROP) == null && (target instanceof CrosstabTableEditPart || target instanceof CrosstabCellEditPart)) {
      return DNDService.LOGIC_TRUE;
    }
  }
  return DNDService.LOGIC_UNKNOW;
}
Program: 74965
Project: 74965
Buggy source:
/** 
 * If caller does not have a scope for evaluation, the caller can use this method to evaluate expression. But if caller has its own scope which can be used, the better way is call the method of convertToJavascriptValue( Object value, Scriptable scope ).
 * @param value
 * @return
 */
public static Object convertToJavascriptValue(Object value){
  if (sharedScope == null) {
    Context cx=Context.enter();
    sharedScope=new ImporterTopLevel(cx);
    Context.exit();
  }
  return convertToJavascriptValue(value,sharedScope);
}

Fixed version (ground truth):
/** 
 * If caller does not have a scope for evaluation, the caller can use this method to evaluate expression. But if caller has its own scope which can be used, the better way is call the method of convertToJavascriptValue( Object value, Scriptable scope ).
 * @param value
 * @return
 */
public static Object convertToJavascriptValue(Object value){
  return convertToJavascriptValue(value,null);
}
Program: 74966
Project: 74966
Buggy source:
public Object get(String name,Scriptable start){
  if ("String_Node_Str".equalsIgnoreCase(name)) {
    if (this.helper.getParent() != null)     return helper.getParent().getJSRowObject();
 else     return null;
  }
  int rowIndex=-1;
  try {
    rowIndex=odiResult.getCurrentResultIndex();
  }
 catch (  BirtException e1) {
  }
  if ("String_Node_Str".equalsIgnoreCase(name) || "String_Node_Str".equalsIgnoreCase(name)) {
    return new Integer(rowIndex);
  }
  if (rowIndex == currRowIndex && valueCacheMap.containsKey(name)) {
    return valueCacheMap.get(name);
  }
 else {
    Object value=null;
    try {
      IBinding binding=this.exprManager.getBinding(name);
      if (binding == null) {
        return new DataExceptionMocker(new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name));
      }
      if (binding.getAggrFunction() != null)       return this.odiResult.getAggrValue(name);
      IBaseExpression dataExpr=this.exprManager.getExpr(name);
      if (dataExpr == null) {
        return new DataExceptionMocker(new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name));
      }
      value=ExprEvaluateUtil.evaluateValue(dataExpr,this.odiResult.getCurrentResultIndex(),this.odiResult.getCurrentResult(),this.scope);
    }
 catch (    BirtException e) {
      value=null;
    }
    if (this.currRowIndex != rowIndex) {
      this.valueCacheMap.clear();
      this.currRowIndex=rowIndex;
    }
    value=JavascriptEvalUtil.convertToJavascriptValue(value);
    valueCacheMap.put(name,value);
    return value;
  }
}

Fixed version (ground truth):
public Object get(String name,Scriptable start){
  if ("String_Node_Str".equalsIgnoreCase(name)) {
    if (this.helper.getParent() != null)     return helper.getParent().getJSRowObject();
 else     return null;
  }
  int rowIndex=-1;
  try {
    rowIndex=odiResult.getCurrentResultIndex();
  }
 catch (  BirtException e1) {
  }
  if ("String_Node_Str".equalsIgnoreCase(name) || "String_Node_Str".equalsIgnoreCase(name)) {
    return new Integer(rowIndex);
  }
  if (rowIndex == currRowIndex && valueCacheMap.containsKey(name)) {
    return valueCacheMap.get(name);
  }
 else {
    Object value=null;
    try {
      IBinding binding=this.exprManager.getBinding(name);
      if (binding == null) {
        return new DataExceptionMocker(new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name));
      }
      if (binding.getAggrFunction() != null)       return this.odiResult.getAggrValue(name);
      IBaseExpression dataExpr=this.exprManager.getExpr(name);
      if (dataExpr == null) {
        return new DataExceptionMocker(new DataException(ResourceConstants.INVALID_BOUND_COLUMN_NAME,name));
      }
      value=ExprEvaluateUtil.evaluateValue(dataExpr,this.odiResult.getCurrentResultIndex(),this.odiResult.getCurrentResult(),this.scope);
    }
 catch (    BirtException e) {
      value=null;
    }
    if (this.currRowIndex != rowIndex) {
      this.valueCacheMap.clear();
      this.currRowIndex=rowIndex;
    }
    value=JavascriptEvalUtil.convertToJavascriptValue(value,this.scope);
    valueCacheMap.put(name,value);
    return value;
  }
}
Program: 74967
Project: 74967
Buggy source:
public INode getParent(){
  return parent;
}

Fixed version (ground truth):
public IContainerNode getParent(){
  return parent;
}
Program: 74968
Project: 74968
Buggy source:
public void setParent(INode parent){
  this.parent=parent;
}

Fixed version (ground truth):
public void setParent(IContainerNode parent){
  this.parent=parent;
}
Program: 74973
Project: 74973
Buggy source:
/** 
 * @throws BirtException
 */
private void useCache3() throws BirtException {
  DataEngine myDataEngine=newDataEngine();
  IResultIterator parentRi=getResultIterator1(myDataEngine);
  parentRi.next();
  IResultIterator ri=parentRi.getSecondaryIterator("String_Node_Str",scope);
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    Object ob1=it.next();
    Object ob2=ri.getValue("String_Node_Str");
    assertEquals(ob1,ob2);
    str+="String_Node_Str" + ob2.toString();
    System.out.println("String_Node_Str" + str);
  }
  ri.close();
  parentRi.close();
  myDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void useCache3() throws BirtException {
  myDataEngine=newDataEngine();
  IResultIterator parentRi=getResultIterator1(myDataEngine);
  parentRi.next();
  IResultIterator ri=parentRi.getSecondaryIterator("String_Node_Str",scope);
  Iterator it=this.expectedValue.iterator();
  while (ri.next()) {
    String str="String_Node_Str";
    Object ob1=it.next();
    Object ob2=ri.getValue("String_Node_Str");
    assertEquals(ob1,ob2);
    str+="String_Node_Str" + ob2.toString();
    System.out.println("String_Node_Str" + str);
  }
  ri.close();
  parentRi.close();
  myDataEngine.shutdown();
}
Program: 74974
Project: 74974
Buggy source:
/** 
 * @throws BirtException
 */
private void genCache3() throws BirtException {
  this.dataSet.setCacheRowCount(4);
  DataEngine myDataEngine=newDataEngine();
  IResultIterator parentRi=getResultIterator1(myDataEngine);
  parentRi.next();
  IResultIterator ri=parentRi.getSecondaryIterator("String_Node_Str",scope);
  ;
  while (ri.next()) {
    expectedValue.add(ri.getValue("String_Node_Str"));
  }
  assertEquals(expectedValue.size(),1);
  ri.close();
  parentRi.close();
  myDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void genCache3() throws BirtException {
  this.dataSet.setCacheRowCount(4);
  myDataEngine=newDataEngine();
  IResultIterator parentRi=getResultIterator1(myDataEngine);
  parentRi.next();
  IResultIterator ri=parentRi.getSecondaryIterator("String_Node_Str",scope);
  ;
  while (ri.next()) {
    expectedValue.add(ri.getValue("String_Node_Str"));
  }
  assertEquals(expectedValue.size(),1);
  ri.close();
  parentRi.close();
  myDataEngine.shutdown();
}
Program: 74975
Project: 74975
Buggy source:
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseCache() throws BirtException {
  this.dataSet.setCacheRowCount(4);
  DataEngineImpl myDataEngine=newDataEngine();
  assertFalse(getDataSetCacheManager(myDataEngine).doesLoadFromCache());
  assertFalse(getDataSetCacheManager(myDataEngine).doesSaveToCache());
  QueryDefinition qd=this.newReportQuery();
  rowBeArray=getRowExpr();
  totalBeArray=getAggrExpr();
  bindingNameRow=getRowExprName();
  bindingExprRow=getAggrExprName();
  prepareExprNameAndQuery(rowBeArray,bindingNameRow,totalBeArray,bindingExprRow,qd);
  IQueryResults qr=myDataEngine.prepare(qd,appContextMap).execute(null);
  qr.getResultIterator().next();
  qr.close();
  assertTrue(getDataSetCacheManager(myDataEngine).doesLoadFromCache());
  assertFalse(getDataSetCacheManager(myDataEngine).doesSaveToCache());
  getDataSetCacheManager(myDataEngine).resetForTest();
  myDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseCache() throws BirtException {
  this.dataSet.setCacheRowCount(4);
  myDataEngine=newDataEngine();
  assertFalse(getDataSetCacheManager(myDataEngine).doesLoadFromCache());
  assertFalse(getDataSetCacheManager(myDataEngine).doesSaveToCache());
  QueryDefinition qd=this.newReportQuery();
  rowBeArray=getRowExpr();
  totalBeArray=getAggrExpr();
  bindingNameRow=getRowExprName();
  bindingExprRow=getAggrExprName();
  prepareExprNameAndQuery(rowBeArray,bindingNameRow,totalBeArray,bindingExprRow,qd);
  IQueryResults qr=myDataEngine.prepare(qd,appContextMap).execute(null);
  qr.getResultIterator().next();
  qr.close();
  assertTrue(getDataSetCacheManager(myDataEngine).doesLoadFromCache());
  assertFalse(getDataSetCacheManager(myDataEngine).doesSaveToCache());
  getDataSetCacheManager(myDataEngine).resetForTest();
  myDataEngine.shutdown();
}
Program: 74976
Project: 74976
Buggy source:
/** 
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit3() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(4));
  this.testUseCache1();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit3() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(4));
  this.testUseCache1();
}
Program: 74977
Project: 74977
Buggy source:
/** 
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,100);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(0));
  this.testUseCache1();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
public void testUseAppContextCacheRowLimit1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,100);
  myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(0));
  this.testUseCache1();
}
Program: 74978
Project: 74978
Buggy source:
/** 
 * @throws BirtException
 */
private void genCache() throws BirtException {
  this.dataSet.setCacheRowCount(4);
  DataEngine myDataEngine=newDataEngine();
  IResultIterator ri=getResultIterator1(myDataEngine);
  while (ri.next()) {
    for (int i=0; i < bindingNameRow.length; i++)     expectedValue.add(ri.getValue(bindingNameRow[i]));
    for (int i=0; i < totalBeArray.length; i++)     expectedValue.add(ri.getValue(bindingExprRow[i]));
  }
  ri.close();
  myDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void genCache() throws BirtException {
  this.dataSet.setCacheRowCount(4);
  myDataEngine=newDataEngine();
  IResultIterator ri=getResultIterator1(myDataEngine);
  while (ri.next()) {
    for (int i=0; i < bindingNameRow.length; i++)     expectedValue.add(ri.getValue(bindingNameRow[i]));
    for (int i=0; i < totalBeArray.length; i++)     expectedValue.add(ri.getValue(bindingExprRow[i]));
  }
  ri.close();
  myDataEngine.shutdown();
}
Program: 74979
Project: 74979
Buggy source:
/** 
 * Test acqurire inexist save cache result meta 
 */
public void testUseCachedMeta2() throws BirtException {
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(0));
  this.genCache();
  DataEngine myDataEngine=newDataEngine();
  IResultMetaData meta=myDataEngine.getCachedDataSetMetaData(dataSource,dataSet);
  assertTrue(meta == null);
}

Fixed version (ground truth):
/** 
 * Test acqurire inexist save cache result meta 
 */
public void testUseCachedMeta2() throws BirtException {
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(0));
  this.genCache();
  myDataEngine=newDataEngine();
  IResultMetaData meta=myDataEngine.getCachedDataSetMetaData(dataSource,dataSet);
  assertTrue(meta == null);
}
Program: 74980
Project: 74980
Buggy source:
public void setUp() throws Exception {
  super.setUp();
  Context context=Context.enter();
  scope=context.initStandardObjects();
  Context.exit();
  expectedValue=new ArrayList();
  appContextMap.put(DataEngine.DATASET_CACHE_OPTION,"String_Node_Str");
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,null);
  DataEngine myDataEngine=newDataEngine();
  myDataEngine.clearCache(this.dataSource,this.dataSet);
}

Fixed version (ground truth):
public void setUp() throws Exception {
  super.setUp();
  Context context=Context.enter();
  scope=context.initStandardObjects();
  Context.exit();
  expectedValue=new ArrayList();
  appContextMap.put(DataEngine.DATASET_CACHE_OPTION,"String_Node_Str");
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,null);
  myDataEngine=newDataEngine();
}
Program: 74981
Project: 74981
Buggy source:
/** 
 * @throws BirtException
 */
public void testUseAppContextMemoryCache2() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(2);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,3);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(3));
  this.testUseCache1();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
public void testUseAppContextMemoryCache2() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(2);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,3);
  myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(3));
  this.testUseCache1();
}
Program: 74982
Project: 74982
Buggy source:
/** 
 * Test acqurire save cache result meta 
 */
public void testUseCachedMeta1() throws BirtException {
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(1));
  this.genCache();
  DataEngine myDataEngine=newDataEngine();
  IResultMetaData meta=myDataEngine.getCachedDataSetMetaData(dataSource,dataSet);
  assertTrue(meta != null);
  assertTrue(meta.getColumnCount() == 6);
}

Fixed version (ground truth):
/** 
 * Test acquire saved cache result meta 
 */
public void testUseCachedMeta1() throws BirtException {
  this.appContextMap.put(DataEngine.DATA_SET_CACHE_ROW_LIMIT,new Integer(1));
  this.genCache();
  myDataEngine=newDataEngine();
  IResultMetaData meta=myDataEngine.getCachedDataSetMetaData(dataSource,dataSet);
  assertTrue(meta != null);
  assertTrue(meta.getColumnCount() == 6);
}
Program: 74983
Project: 74983
Buggy source:
/** 
 * @throws BirtException
 */
public void testUseAppContextMemoryCache1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(7);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,100);
  DataEngineImpl myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(7));
  this.testUseCache1();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
public void testUseAppContextMemoryCache1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(7);
  DataEngineContext dec=DataEngineContext.newInstance(DataEngineContext.DIRECT_PRESENTATION,null,null,null);
  dec.setCacheOption(DataEngineContext.CACHE_USE_ALWAYS,100);
  myDataEngine=(DataEngineImpl)DataEngine.newDataEngine(dec);
  myDataEngine.defineDataSource(this.dataSource);
  myDataEngine.defineDataSet(this.dataSet);
  this.appContextMap.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(7));
  this.testUseCache1();
}
Program: 74984
Project: 74984
Buggy source:
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseCache1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  DataEngineImpl myDataEngine=newDataEngine();
  assertFalse(getDataSetCacheManager(myDataEngine).doesLoadFromCache());
  assertFalse(getDataSetCacheManager(myDataEngine).doesSaveToCache());
  executeQuery(myDataEngine);
}

Fixed version (ground truth):
/** 
 * Test feature of whether cache will be used
 * @throws BirtException
 */
public void testUseCache1() throws BirtException, Exception {
  this.dataSet.setCacheRowCount(100);
  myDataEngine=newDataEngine();
  assertFalse(getDataSetCacheManager(myDataEngine).doesLoadFromCache());
  assertFalse(getDataSetCacheManager(myDataEngine).doesSaveToCache());
  executeQuery(myDataEngine);
}
Program: 74985
Project: 74985
Buggy source:
public void tearDown() throws Exception {
  super.tearDown();
}

Fixed version (ground truth):
public void tearDown() throws Exception {
  super.tearDown();
  myDataEngine.clearCache(this.dataSource,this.dataSet);
}
Program: 74986
Project: 74986
Buggy source:
/** 
 * @throws BirtException
 */
private void useCache() throws BirtException {
  DataEngine myDataEngine=newDataEngine();
  IResultIterator ri=getResultIterator1(myDataEngine);
  checkResult(ri);
  ri.close();
  myDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void useCache() throws BirtException {
  myDataEngine=newDataEngine();
  IResultIterator ri=getResultIterator1(myDataEngine);
  checkResult(ri);
  ri.close();
  myDataEngine.shutdown();
}
Program: 74987
Project: 74987
Buggy source:
/** 
 * Test acqurire save cache result meta 
 */
public void testUseMemoryCachedMeta1() throws BirtException {
  this.appContextMap.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(1));
  this.genCache();
  DataEngine myDataEngine=newDataEngine();
  IResultMetaData meta=myDataEngine.getCachedDataSetMetaData(dataSource,dataSet);
  assertTrue(meta != null);
  assertTrue(meta.getColumnCount() == 6);
}

Fixed version (ground truth):
/** 
 * Test acqurire save cache result meta 
 */
public void testUseMemoryCachedMeta1() throws BirtException {
  this.appContextMap.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(1));
  this.genCache();
  myDataEngine=newDataEngine();
  IResultMetaData meta=myDataEngine.getCachedDataSetMetaData(dataSource,dataSet);
  assertTrue(meta != null);
  assertTrue(meta.getColumnCount() == 6);
}
Program: 74988
Project: 74988
Buggy source:
/** 
 * Test acqurire inexist save cache result meta 
 */
public void testUseMemoryCachedMeta2() throws BirtException {
  this.appContextMap.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(0));
  DataEngine myDataEngine=newDataEngine();
  IResultIterator ri=getResultIterator1(myDataEngine);
  while (ri.next()) {
    for (int i=0; i < bindingNameRow.length; i++)     expectedValue.add(ri.getValue(bindingNameRow[i]));
    for (int i=0; i < totalBeArray.length; i++)     expectedValue.add(ri.getValue(bindingExprRow[i]));
  }
  ri.close();
  IResultMetaData meta=myDataEngine.getCachedDataSetMetaData(dataSource,dataSet);
  assertTrue(meta == null);
}

Fixed version (ground truth):
/** 
 * Test acqurire inexist save cache result meta 
 */
public void testUseMemoryCachedMeta2() throws BirtException {
  this.appContextMap.put(DataEngine.MEMORY_DATA_SET_CACHE,new Integer(0));
  myDataEngine=newDataEngine();
  IResultIterator ri=getResultIterator1(myDataEngine);
  while (ri.next()) {
    for (int i=0; i < bindingNameRow.length; i++)     expectedValue.add(ri.getValue(bindingNameRow[i]));
    for (int i=0; i < totalBeArray.length; i++)     expectedValue.add(ri.getValue(bindingExprRow[i]));
  }
  ri.close();
  IResultMetaData meta=myDataEngine.getCachedDataSetMetaData(dataSource,dataSet);
  assertTrue(meta == null);
}
Program: 74989
Project: 74989
Buggy source:
/** 
 * This method is invoked when the find button is clicked It populates the Available Data Base obecets ( in the Tree control )
 */
protected void populateAvailableDbObjects(){
  DataSetDesign dataSetDesign=getDataSetDesign();
  DataSourceDesign curDataSourceDesign=dataSetDesign.getDataSourceDesign();
  if (curDataSourceDesign == prevDataSourceDesign) {
    if ((cachedSearchTxt == searchTxt.getText() || (cachedSearchTxt != null && cachedSearchTxt.equals(searchTxt.getText()))) && (cachedDbType == getSelectedDbType() || (cachedDbType != null && cachedDbType.equals(getSelectedDbType())))) {
      if (schemaList != null && schemaList.size() > 0) {
        if (cachedSchemaComboIndex == schemaCombo.getSelectionIndex()) {
          return;
        }
      }
 else       return;
    }
  }
  RemoveAllAvailableDbObjects();
  setRootElement();
  setRefreshInfo();
  if (isSchemaSupported) {
    populateSchemaList();
  }
 else {
    populateTableList();
  }
  addFetchDbObjectListener();
  if (rootNode != null) {
    selectNode(rootNode);
  }
}

Fixed version (ground truth):
/** 
 * This method is invoked when the find button is clicked It populates the Available Data Base obecets ( in the Tree control )
 */
protected void populateAvailableDbObjects(){
  DataSetDesign dataSetDesign=getDataSetDesign();
  DataSourceDesign curDataSourceDesign=dataSetDesign.getDataSourceDesign();
  if (curDataSourceDesign == prevDataSourceDesign) {
    if ((cachedSearchTxt == searchTxt.getText() || (cachedSearchTxt != null && cachedSearchTxt.equals(searchTxt.getText()))) && (cachedDbType == getSelectedDbType() || (cachedDbType != null && cachedDbType.equals(getSelectedDbType())))) {
      if (schemaList != null && schemaList.size() > 0) {
        if (cachedSchemaComboIndex == schemaCombo.getSelectionIndex()) {
          return;
        }
      }
 else       return;
    }
  }
  removeAllAvailableDbObjects();
  setRootElement();
  setRefreshInfo();
  if (isSchemaSupported) {
    populateSchemaList();
  }
 else {
    populateTableList();
  }
  addFetchDbObjectListener();
  if (rootNode != null) {
    selectNode(rootNode);
  }
}
Program: 74990
Project: 74990
Buggy source:
/** 
 * Initializes the Jdbc related information , used  by this page ( such as the Jdbc Connection , Catalog Name etc )
 * @param curDataSourceHandle
 */
protected void resetJdbcInfo(DataSourceDesign curDataSourceDesign){
  if (metaDataProvider != null) {
    metaDataProvider.closeConnection();
    metaDataProvider=null;
    createMetaDataProvider();
    jdbcConnection=connectMetadataProvider(metaDataProvider,curDataSourceDesign);
    tableList=null;
    schemaList=null;
    schemaCombo.removeAll();
  }
  try {
    if (jdbcConnection != null) {
      isSchemaSupported=metaDataProvider.isSchemaSupported();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.showException(this.getShell(),JdbcPlugin.getResourceString("String_Node_Str"),e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * Initializes the Jdbc related information , used  by this page ( such as the Jdbc Connection , Catalog Name etc )
 * @param curDataSourceHandle
 */
protected void resetJdbcInfo(DataSourceDesign curDataSourceDesign){
  try {
    if (metaDataProvider != null) {
      metaDataProvider.closeConnection();
      metaDataProvider=null;
      createMetaDataProvider();
      if (jdbcConnection != null) {
        jdbcConnection.close();
        jdbcConnection=null;
      }
      jdbcConnection=connectMetadataProvider(metaDataProvider,curDataSourceDesign);
      tableList=null;
      schemaList=null;
      schemaCombo.removeAll();
    }
    if (jdbcConnection != null) {
      isSchemaSupported=metaDataProvider.isSchemaSupported();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.showException(this.getShell(),JdbcPlugin.getResourceString("String_Node_Str"),e.getLocalizedMessage(),e);
  }
}
Program: 74991
Project: 74991
Buggy source:
/** 
 * refresh page
 */
private void refreshPage(){
  DataSourceDesign curDataSourceDesign=this.getDataSetDesign().getDataSourceDesign();
  if (curDataSourceDesign != prevDataSourceDesign) {
    RemoveAllAvailableDbObjects();
    resetJdbcInfo(curDataSourceDesign);
    enableSchemaComponent(isSchemaSupported);
    setRootElement();
    sourceViewerConfiguration.getContentAssistProcessor().setDataSourceHandle(curDataSourceDesign);
    populateAvailableDbObjects();
    prevDataSourceDesign=curDataSourceDesign;
    try {
      if (metaDataProvider.getConnection() == null || this.getDataSetDesign().getQueryText() == null || this.getDataSetDesign().getQueryText().trim().length() == 0)       return;
      ResultSetMetaData meta=null;
      try {
        meta=this.metaDataProvider.getConnection().prepareStatement(this.getDataSetDesign().getQueryText()).getMetaData();
      }
 catch (      SQLException e) {
        try {
          meta=this.metaDataProvider.getConnection().prepareStatement(this.getDataSetDesign().getQueryText()).executeQuery().getMetaData();
        }
 catch (        Exception ex) {
          meta=null;
        }
      }
      if (meta == null)       return;
      if (this.getDataSetDesign().getPrimaryResultSet() == null) {
        this.shouldUpdateDataSetDesign=true;
        return;
      }
      ResultSetColumns rsc=this.getDataSetDesign().getPrimaryResultSet().getResultSetColumns();
      if (meta.getColumnCount() != rsc.getResultColumnDefinitions().size()) {
        this.shouldUpdateDataSetDesign=true;
        return;
      }
      for (int i=0; i < rsc.getResultColumnDefinitions().size(); i++) {
        ColumnDefinition cd=(ColumnDefinition)rsc.getResultColumnDefinitions().get(i);
        if (!(cd.getAttributes().getName().equals(meta.getColumnName(i + 1)) && cd.getAttributes().getNativeDataTypeCode() == meta.getColumnType(i + 1))) {
          this.shouldUpdateDataSetDesign=true;
          return;
        }
      }
    }
 catch (    SQLException e) {
      logger.log(Level.FINE,e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * refresh page
 */
private void refreshPage(){
  DataSourceDesign curDataSourceDesign=this.getDataSetDesign().getDataSourceDesign();
  if (curDataSourceDesign != prevDataSourceDesign) {
    resetJdbcInfo(curDataSourceDesign);
    setPageLayout();
    prevDataSourceDesign=curDataSourceDesign;
  }
}
Program: 74992
Project: 74992
Buggy source:
/** 
 * initial dataset control
 */
private void initializeControl(){
  isPageInitialization=true;
  initializeSchemaPrefetchConfig();
  DEFAULT_MESSAGE=JdbcPlugin.getResourceString("String_Node_Str");
  setMessage(DEFAULT_MESSAGE,IMessageProvider.NONE);
  refreshPage();
  prepareUI();
}

Fixed version (ground truth):
/** 
 * initial dataset control
 */
private void initializeControl(){
  isPageInitialization=true;
  initializeSchemaPrefetchConfig();
  DEFAULT_MESSAGE=JdbcPlugin.getResourceString("String_Node_Str");
  setMessage(DEFAULT_MESSAGE,IMessageProvider.NONE);
  setPageLayout();
  prevDataSourceDesign=this.getDataSetDesign().getDataSourceDesign();
  prepareUI();
}
Program: 74994
Project: 74994
Buggy source:
public boolean close(){
}

Fixed version (ground truth):
public boolean close(){
  IDialogSettings setting=getDialogBoundsSettings();
  setting.put(SASHFORM_LEFT,widthHints[0]);
  setting.put(SASHFORM_RIGHT,widthHints[1]);
  return super.close();
}
Program: 74995
Project: 74995
Buggy source:
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout=new GridLayout();
  layout.numColumns=1;
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  composite.setLayout(layout);
  sashForm=new SashForm(composite,SWT.NONE);
  sashForm.setOrientation(SWT.HORIZONTAL);
  sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
  createTreeViewer(sashForm);
  createPropertyPane(sashForm);
  Label label=new Label(composite,SWT.HORIZONTAL | SWT.SEPARATOR);
  label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  initTreeSelection();
  return composite;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout=new GridLayout();
  layout.numColumns=1;
  layout.marginWidth=convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
  layout.marginHeight=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
  layout.verticalSpacing=convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
  composite.setLayout(layout);
  container=new Composite(composite,SWT.NONE);
  layout=new GridLayout();
  layout.numColumns=3;
  layout.marginWidth=0;
  layout.marginHeight=0;
  layout.horizontalSpacing=2;
  container.setLayout(layout);
  container.setLayoutData(new GridData(GridData.FILL_BOTH));
  treeViewer=createTreeViewer(container);
  treeViewer.setLayoutData(new GridData(GridData.FILL_VERTICAL));
  Sash sash=createSash(container);
  pageContainer=createPropertyPane(container);
  pageContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
  addDragListerner(sash,container,treeViewer,pageContainer);
  Label label=new Label(composite,SWT.HORIZONTAL | SWT.SEPARATOR);
  label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  initTreeSelection();
  return composite;
}
Program: 74996
Project: 74996
Buggy source:
protected void initializeBounds(){
  try {
    IDialogSettings setting=getDialogBoundsSettings();
    int leftWeight=setting.getInt(SASHFORM_LEFT);
    int rightWeight=setting.getInt(SASHFORM_RIGHT);
    sashForm.setWeights(new int[]{leftWeight,rightWeight});
  }
 catch (  NumberFormatException e) {
    sashForm.setWeights(new int[]{20,80});
  }
  super.initializeBounds();
}

Fixed version (ground truth):
protected void initializeBounds(){
  try {
    IDialogSettings setting=getDialogBoundsSettings();
    widthHints[0]=setting.getInt(SASHFORM_LEFT);
    widthHints[1]=setting.getInt(SASHFORM_RIGHT);
  }
 catch (  NumberFormatException e) {
    final int total=getDefaultSize().x;
    widthHints[0]=(int)(total * 0.2);
    widthHints[1]=(int)(total * 0.8);
  }
  GridData data=(GridData)treeViewer.getLayoutData();
  data.widthHint=widthHints[0];
  data=(GridData)pageContainer.getLayoutData();
  data.widthHint=widthHints[1];
  container.layout(true);
  super.initializeBounds();
}
Program: 74998
Project: 74998
Buggy source:
/** 
 * Unload any resources associated with the graphic context
 */
public void flush(){
  StringBuffer buffer=new StringBuffer(EventHandlers.content);
  codeScript.appendChild(dom.createCDATASection(buffer.append(scriptBuffer).toString()));
  buffer=new StringBuffer(EventHandlers.styles);
  styles.appendChild(dom.createCDATASection(buffer.append(styleBuffer).toString()));
  scriptBuffer=new StringBuffer();
  styleBuffer=new StringBuffer();
}

Fixed version (ground truth):
/** 
 * Unload any resources associated with the graphic context
 */
public void flush(){
  StringBuffer buffer=new StringBuffer(EventHandlers.content.toString());
  codeScript.appendChild(dom.createCDATASection(buffer.append(scriptBuffer).toString()));
  buffer=new StringBuffer(EventHandlers.styles.toString());
  styles.appendChild(dom.createCDATASection(buffer.append(styleBuffer).toString()));
  scriptBuffer=new StringBuffer();
  styleBuffer=new StringBuffer();
}
Program: 75000
Project: 75000
Buggy source:
public IResultSet executeQuery() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  if (this.cachedResultSet != null) {
    IResultSet ret=this.cachedResultSet;
    this.cachedResultSet=null;
    return ret;
  }
  try {
    if (!maxRowsUpToDate) {
      try {
        assertNotNull(callStat);
        callStat.setMaxRows(maxrows);
      }
 catch (      SQLException e1) {
      }
      maxRowsUpToDate=true;
    }
    registerOutputParameter();
    this.callStat.execute();
    if (this.callStat.getResultSet() != null)     return new ResultSet(this.callStat.getResultSet());
    java.sql.ResultSet resultSet=getOutputParamResultSet();
    if (resultSet != null)     return new ResultSet(resultSet);
 else     return new SPResultSet(null);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_RETURN,e);
  }
}

Fixed version (ground truth):
public IResultSet executeQuery() throws OdaException {
  logger.logp(java.util.logging.Level.FINE,CallStatement.class.getName(),"String_Node_Str","String_Node_Str");
  if (this.cachedResultSet != null) {
    IResultSet ret=this.cachedResultSet;
    this.cachedResultSet=null;
    return ret;
  }
  try {
    if (!maxRowsUpToDate) {
      try {
        assertNotNull(callStat);
        callStat.setMaxRows(maxrows);
      }
 catch (      SQLException e1) {
      }
      maxRowsUpToDate=true;
    }
    registerOutputParameter();
    java.sql.ResultSet rs=this.callStat.executeQuery();
    if (rs != null)     return new ResultSet(rs);
    java.sql.ResultSet resultSet=getOutputParamResultSet();
    if (resultSet != null)     return new ResultSet(resultSet);
 else     return new SPResultSet(null);
  }
 catch (  SQLException e) {
    throw new JDBCException(ResourceConstants.RESULTSET_CANNOT_RETURN,e);
  }
}
Program: 75001
Project: 75001
Buggy source:
/** 
 * Init context.
 * @param request incoming http request
 * @param response http response
 * @exception BirtException
 * @return IContext
 */
protected IContext __getContext(HttpServletRequest request,HttpServletResponse response) throws BirtException {
  BirtReportServiceFactory.getReportService().setContext(getServletContext(),null);
  return new BirtContext(request,response);
}

Fixed version (ground truth):
/** 
 * Init context.
 * @param request incoming http request
 * @param response http response
 * @exception BirtException
 * @return IContext
 */
protected IContext __getContext(HttpServletRequest request,HttpServletResponse response) throws BirtException {
  try {
    request.setCharacterEncoding(ParameterAccessor.UTF_8_ENCODE);
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  BirtReportServiceFactory.getReportService().setContext(getServletContext(),null);
  return new BirtContext(request,response);
}
Program: 75002
Project: 75002
Buggy source:
/** 
 * Init context.
 * @param request incoming http request
 * @param response http response
 * @exception BirtException
 * @return IContext
 */
protected IContext __getContext(HttpServletRequest request,HttpServletResponse response) throws BirtException {
  BirtReportServiceFactory.getReportService().setContext(getServletContext(),null);
  return new BirtContext(request,response);
}

Fixed version (ground truth):
/** 
 * Init context.
 * @param request incoming http request
 * @param response http response
 * @exception BirtException
 * @return IContext
 */
protected IContext __getContext(HttpServletRequest request,HttpServletResponse response) throws BirtException {
  try {
    request.setCharacterEncoding(ParameterAccessor.UTF_8_ENCODE);
  }
 catch (  UnsupportedEncodingException e) {
    e.printStackTrace();
  }
  BirtReportServiceFactory.getReportService().setContext(getServletContext(),null);
  return new BirtContext(request,response);
}