nus-yam/ex-repair huggingface dataset:
Program: 72607
Project: 72607
Buggy source:
public static JSObjectMetaData[] getAllEnginJSObjects(){
  return (JSObjectMetaData[])engineObjectMap.values().toArray(new JSObjectMetaData[engineObjectMap.values().size()]);
}

Fixed version (ground truth):
public static JSObjectMetaData[] getAllEnginJSObjects(){
  return engineObjectMap.values().toArray(new JSObjectMetaData[engineObjectMap.values().size()]);
}
Program: 72608
Project: 72608
Buggy source:
public static JSObjectMetaData getJavaClassMeta(String className) throws ClassNotFoundException {
  JSObjectMetaData meta=null;
  if (!classMap.containsKey(className)) {
    meta=new JavaClassJSObject(className);
    classMap.put(className,meta);
  }
 else {
    meta=(JSObjectMetaData)classMap.get(className);
  }
  return meta;
}

Fixed version (ground truth):
public static JSObjectMetaData getJavaClassMeta(String className) throws ClassNotFoundException {
  if (className == null) {
    return null;
  }
  JSObjectMetaData meta=null;
  if (!javaObjectMap.containsKey(className)) {
    meta=new JavaClassJSObject(className);
    javaObjectMap.put(className,meta);
  }
 else {
    meta=javaObjectMap.get(className);
  }
  return meta;
}
Program: 72609
Project: 72609
Buggy source:
private void printCube(CubeCursor cursor,List columnEdgeBindingNames,String rowEdgeBindingNames,String measureBindingNames,String columnAggr,String rowAggr,String overallAggr) throws Exception {
  EdgeCursor edge1=(EdgeCursor)(cursor.getOrdinateEdge().get(0));
  EdgeCursor edge2=(EdgeCursor)(cursor.getOrdinateEdge().get(1));
  String[] lines=new String[edge1.getDimensionCursor().size()];
  for (int i=0; i < lines.length; i++) {
    lines[i]="String_Node_Str";
  }
  while (edge1.next()) {
    for (int i=0; i < lines.length; i++) {
      lines[i]+=cursor.getObject(columnEdgeBindingNames.get(i).toString()) + "String_Node_Str";
    }
  }
  if (rowAggr != null)   lines[lines.length - 1]+="String_Node_Str";
  String output="String_Node_Str";
  for (int i=0; i < lines.length; i++) {
    output+="String_Node_Str" + lines[i];
  }
  while (edge2.next()) {
    String line=cursor.getObject(rowEdgeBindingNames).toString() + "String_Node_Str";
    edge1.beforeFirst();
    while (edge1.next()) {
      line+=cursor.getObject(measureBindingNames) + "String_Node_Str";
    }
    if (rowAggr != null)     line+=cursor.getObject(rowAggr);
    output+="String_Node_Str" + line;
  }
  if (columnAggr != null) {
    String line="String_Node_Str" + "String_Node_Str";
    edge1.beforeFirst();
    while (edge1.next()) {
      line+=cursor.getObject(columnAggr) + "String_Node_Str";
    }
    if (overallAggr != null)     line+=cursor.getObject(overallAggr);
    output+="String_Node_Str" + line;
  }
  this.testPrint(output);
  this.checkOutputFile();
}

Fixed version (ground truth):
private void printCube(CubeCursor cursor,List columnEdgeBindingNames,List rowEdgeBindingNames,String measureBindingName,String[] columnAggrs) throws Exception {
  String output=getOutputFromCursor(cursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingName,columnAggrs);
  this.testPrint(output);
}
Program: 72610
Project: 72610
Buggy source:
/** 
 * @param result
 * @param key
 * @throws EngineException 
 */
private void addConditionalExprBindings(TotalExprBinding result,IConditionalExpression key,List bindings,String groupName,boolean isCube) throws EngineException {
  try {
    IConditionalExpression ce=key;
    if (!hasAggregationInFilter(key)) {
      result.addNewExpression(ce);
      return;
    }
    if (groupName != null)     ce.setGroupName(groupName);
    String bindingName=TOTAL_PREFIX + totalColumnSuffix;
    totalColumnSuffix++;
    Binding columnBinding=new Binding(bindingName,ce);
    if (groupName != null) {
      columnBinding.addAggregateOn(groupName);
    }
    List allColumnBindings=new ArrayList();
    allColumnBindings.add(columnBinding);
    result.addColumnBindings(allColumnBindings);
    if (!isCube) {
      result.addNewExpression(org.eclipse.birt.core.data.ExpressionUtil.createJSRowExpression(bindingName));
    }
 else {
      result.addNewExpression(org.eclipse.birt.core.data.ExpressionUtil.createJSDataExpression(bindingName));
    }
  }
 catch (  DataException e) {
    throw new EngineException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param result
 * @param key
 * @throws EngineException 
 */
private void addConditionalExprBindings(TotalExprBinding result,IConditionalExpression key,List bindings,String groupName,boolean isCube) throws EngineException {
  try {
    IConditionalExpression ce=key;
    if (!hasAggregationInFilter(key)) {
      result.addNewExpression(ce);
      return;
    }
    if (groupName != null)     ce.setGroupName(groupName);
    String bindingName=TOTAL_PREFIX + totalColumnSuffix;
    totalColumnSuffix++;
    Binding columnBinding=new Binding(bindingName,ce);
    if (groupName != null) {
      columnBinding.addAggregateOn(groupName);
    }
    List allColumnBindings=new ArrayList();
    allColumnBindings.add(columnBinding);
    result.addColumnBindings(allColumnBindings);
    if (!isCube) {
      result.addNewExpression(org.eclipse.birt.core.data.ExpressionUtil.createJSRowExpression(bindingName));
    }
 else {
      result.addNewExpression(org.eclipse.birt.core.data.ExpressionUtil.createJSDataExpression(bindingName));
    }
  }
 catch (  DataException e) {
    throw new EngineException(e);
  }
}
Program: 72612
Project: 72612
Buggy source:
public IBaseResultSet executeQuery(IBaseResultSet parent,IDataQueryDefinition query,Object handle){
  IDataEngine dataEngine=context.getDataEngine();
  if (query != null) {
    boolean useCache=false;
    if (handle instanceof ReportItemHandle) {
      ReportItemHandle referenceHandle=((ReportItemHandle)handle).getDataBindingReference();
      if (referenceHandle != null) {
        useCache=true;
      }
    }
    try {
      IBaseResultSet rset=dataEngine.execute(parent,query,useCache);
      context.setResultSet(rset);
      return rset;
    }
 catch (    BirtException ex) {
      log.log(Level.SEVERE,ex.getMessage(),ex);
      context.addException(this.getDesignHandle(),new EngineException(ex.getLocalizedMessage(),ex));
      return null;
    }
  }
  return null;
}

Fixed version (ground truth):
public IBaseResultSet executeQuery(IBaseResultSet parent,IDataQueryDefinition query,Object handle){
  IDataEngine dataEngine=context.getDataEngine();
  if (query != null) {
    boolean useCache=false;
    if (handle instanceof ReportItemHandle) {
      ReportItemHandle referenceHandle=((ReportItemHandle)handle).getDataBindingReference();
      if (referenceHandle != null) {
        useCache=true;
      }
    }
    try {
      IBaseResultSet rset=dataEngine.execute(parent,query,useCache);
      context.setResultSet(rset);
      return rset;
    }
 catch (    BirtException ex) {
      log.log(Level.SEVERE,ex.getMessage(),ex);
      context.addException(this.getDesignHandle(),new EngineException(ex));
      return null;
    }
  }
  return null;
}
Program: 72613
Project: 72613
Buggy source:
public IContent execute(){
  ExtendedItemDesign extDesign=(ExtendedItemDesign)design;
  IForeignContent extContent=report.createForeignContent();
  setContent(extContent);
  try {
    executeQueries();
  }
 catch (  BirtException ex) {
    logger.log(Level.SEVERE,ex.getMessage(),ex);
    context.addException(design.getHandle(),new EngineException(ex.getLocalizedMessage(),ex));
    return null;
  }
  initializeContent(extDesign,extContent);
  processAction(extDesign,extContent);
  processBookmark(extDesign,extContent);
  processStyle(extDesign,extContent);
  processVisibility(extDesign,extContent);
  generateContent(extDesign,extContent);
  return extContent;
}

Fixed version (ground truth):
public IContent execute(){
  ExtendedItemDesign extDesign=(ExtendedItemDesign)design;
  IForeignContent extContent=report.createForeignContent();
  setContent(extContent);
  try {
    executeQueries();
  }
 catch (  BirtException ex) {
    logger.log(Level.SEVERE,ex.getMessage(),ex);
    context.addException(design.getHandle(),new EngineException(ex));
    return null;
  }
  initializeContent(extDesign,extContent);
  processAction(extDesign,extContent);
  processBookmark(extDesign,extContent);
  processStyle(extDesign,extContent);
  processVisibility(extDesign,extContent);
  generateContent(extDesign,extContent);
  return extContent;
}
Program: 72614
Project: 72614
Buggy source:
protected void doExecute() throws Exception {
  InstanceID iid=content.getInstanceID();
  DataID dataId=iid.getDataID();
  if (dataId != null) {
    IBaseResultSet rset=getResultSet();
    if (rset == null) {
      rset=restoreParentResultSet();
    }
    if (rset != null) {
      if (rset instanceof IQueryResultSet) {
        IQueryResultSet qrset=(IQueryResultSet)rset;
        long rowId=dataId.getRowID();
        if (rowId != -1) {
          qrset.skipTo(rowId);
        }
      }
 else       if (rset instanceof ICubeResultSet) {
        ICubeResultSet crset=(ICubeResultSet)rset;
        String cid=dataId.getCellID();
        if (cid != null) {
          crset.skipTo(cid);
        }
      }
    }
  }
  executeQuery();
}

Fixed version (ground truth):
protected void doExecute() throws IOException, BirtException {
  InstanceID iid=content.getInstanceID();
  DataID dataId=iid.getDataID();
  if (dataId != null) {
    IBaseResultSet rset=getResultSet();
    if (rset == null) {
      rset=restoreParentResultSet();
    }
    if (rset != null) {
      if (rset instanceof IQueryResultSet) {
        IQueryResultSet qrset=(IQueryResultSet)rset;
        long rowId=dataId.getRowID();
        if (rowId != -1) {
          qrset.skipTo(rowId);
        }
      }
 else       if (rset instanceof ICubeResultSet) {
        ICubeResultSet crset=(ICubeResultSet)rset;
        String cid=dataId.getCellID();
        if (cid != null) {
          crset.skipTo(cid);
        }
      }
    }
  }
  executeQuery();
}
Program: 72615
Project: 72615
Buggy source:
public IContent execute(){
  if (!executed) {
    executed=true;
    try {
      if (offset != -1) {
        generateUniqueID();
        content=reader.loadContent(offset);
        content.setGenerateBy(design);
        instanceId=content.getInstanceID();
        IContent pContent=getParentContent();
        if (pContent != null) {
          content.setParent(pContent);
          instanceId=new InstanceID(pContent.getInstanceID(),instanceId.getUniqueID(),instanceId.getComponentID(),instanceId.getDataID());
          content.setInstanceID(instanceId);
        }
        doExecute();
      }
    }
 catch (    Exception ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      context.addException(this.getDesign(),new EngineException(ex.getLocalizedMessage(),ex));
    }
  }
  return content;
}

Fixed version (ground truth):
public IContent execute(){
  if (!executed) {
    executed=true;
    try {
      if (offset != -1) {
        generateUniqueID();
        content=reader.loadContent(offset);
        content.setGenerateBy(design);
        instanceId=content.getInstanceID();
        IContent pContent=getParentContent();
        if (pContent != null) {
          content.setParent(pContent);
          instanceId=new InstanceID(pContent.getInstanceID(),instanceId.getUniqueID(),instanceId.getComponentID(),instanceId.getDataID());
          content.setInstanceID(instanceId);
        }
        doExecute();
      }
    }
 catch (    BirtException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      context.addException(this.getDesign(),new EngineException(ex));
    }
catch (    IOException ex) {
      logger.log(Level.WARNING,ex.getMessage(),ex);
      context.addException(this.getDesign(),new EngineException(ex.getLocalizedMessage(),ex));
    }
  }
  return content;
}
Program: 72616
Project: 72616
Buggy source:
/** 
 * @param obj
 * @param considerParam
 * @return
 */
public boolean isDataSourceDataSetEqual(DataSourceAndDataSet obj,boolean considerParam){
  IBaseDataSourceDesign dataSourceDesign2=((DataSourceAndDataSet)obj).dataSourceDesign;
  IBaseDataSetDesign dataSetDesign2=((DataSourceAndDataSet)obj).dataSetDesign;
  Collection paramterHints2=((DataSourceAndDataSet)obj).paramterHints;
  if (this.dataSourceDesign == dataSourceDesign2) {
    if (this.dataSetDesign == dataSetDesign2) {
      if (!considerParam)       return true;
      if (isEqualParamterHints(this.paramterHints,paramterHints2))       return true;
    }
 else     if (this.dataSetDesign == null || dataSetDesign2 == null) {
      return false;
    }
  }
 else   if (this.dataSourceDesign == null || dataSourceDesign2 == null) {
    return false;
  }
 else {
    if ((this.dataSetDesign != dataSetDesign2) && (this.dataSetDesign == null || dataSetDesign2 == null))     return false;
  }
  if (isEqualDataSourceDesign(dataSourceDesign,dataSourceDesign2) == false)   return false;
  if (isEqualDataSetDesign(dataSetDesign,dataSetDesign2) == false)   return false;
  if (!considerParam)   return true;
  if (this.isEqualParamterHints(this.paramterHints,paramterHints2) == false)   return false;
  return true;
}

Fixed version (ground truth):
/** 
 * @param obj
 * @param considerParam
 * @return
 */
public boolean isDataSourceDataSetEqual(DataSourceAndDataSet obj,boolean considerParam){
  IBaseDataSourceDesign dataSourceDesign2=((DataSourceAndDataSet)obj).dataSourceDesign;
  IBaseDataSetDesign dataSetDesign2=((DataSourceAndDataSet)obj).dataSetDesign;
  Collection paramterHints2=((DataSourceAndDataSet)obj).paramterHints;
  if (this.dataSourceDesign == dataSourceDesign2) {
    if (this.dataSetDesign == dataSetDesign2) {
      if (!considerParam)       return true;
      if (isEqualParameterHints(this.paramterHints,paramterHints2))       return true;
    }
 else     if (this.dataSetDesign == null || dataSetDesign2 == null) {
      return false;
    }
  }
 else   if (this.dataSourceDesign == null || dataSourceDesign2 == null) {
    return false;
  }
 else {
    if ((this.dataSetDesign != dataSetDesign2) && (this.dataSetDesign == null || dataSetDesign2 == null))     return false;
  }
  if (isEqualDataSourceDesign(dataSourceDesign,dataSourceDesign2) == false)   return false;
  if (isEqualDataSetDesign(dataSetDesign,dataSetDesign2) == false)   return false;
  if (!considerParam)   return true;
  if (this.isEqualParameterHints(this.paramterHints,paramterHints2) == false)   return false;
  return true;
}
Program: 72617
Project: 72617
Buggy source:
public IPageDevice createPageDevice(String title,IReportContext context,IReportContent report) throws Exception {
  currentPageDevice=new PDFPageDevice(output,title,context,report);
  return currentPageDevice;
}

Fixed version (ground truth):
public IPageDevice createPageDevice(String title,String author,String comments,IReportContext context,IReportContent report) throws Exception {
  currentPageDevice=new PDFPageDevice(output,title,author,comments,context,report);
  return currentPageDevice;
}
Program: 72618
Project: 72618
Buggy source:
public IPageDevice createPageDevice(String title,IReportContext context,IReportContent report){
  try {
    return new PostscriptPageDevice(output,title);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
public IPageDevice createPageDevice(String title,String description,String author,IReportContext context,IReportContent report){
  try {
    return new PostscriptPageDevice(output,title,author,description);
  }
 catch (  Exception e) {
    logger.log(Level.SEVERE,e.getMessage());
  }
  return null;
}
Program: 72619
Project: 72619
Buggy source:
public void startRenderer() throws IOException {
  FileUtil.load("String_Node_Str",out);
}

Fixed version (ground truth):
public void startRenderer(String author,String description) throws IOException {
  out.println("String_Node_Str" + author);
  FileUtil.load("String_Node_Str",out);
}
Program: 72620
Project: 72620
Buggy source:
public PostscriptPageDevice(OutputStream output,String title) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  writer.startRenderer();
}

Fixed version (ground truth):
public PostscriptPageDevice(OutputStream output,String title,String author,String description) throws Exception {
  BufferedOutputStream bufferedOutputStream=new BufferedOutputStream(output);
  writer=new PostscriptWriter(bufferedOutputStream,title);
  writer.startRenderer(author,description);
}
Program: 72621
Project: 72621
Buggy source:
/** 
 * @param isLeftDataSet
 * @param dataSetName
 * @return
 * @throws DataException
 */
private IQueryResults populatePreparedQuery(boolean isLeftDataSet,String dataSetName) throws DataException {
  List conditions=PreparedJointDataSourceQuery.this.dataSet.getJoinConditions();
  QueryDefinition queryDefinition=new QueryDefinition();
  queryDefinition.setDataSetName(dataSetName);
  setParameterBindings(dataEngine,dataSetName,isLeftDataSet,queryDefinition);
  for (int i=0; i < conditions.size(); i++) {
    addSortToQuery((IJoinCondition)conditions.get(i),isLeftDataSet,queryDefinition);
  }
  IPreparedQuery preparedQuery=PreparedQueryUtil.newInstance(dataEngine,queryDefinition,appContext);
  try {
    return preparedQuery.execute(null);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * @param isLeftDataSet
 * @param dataSetName
 * @return
 * @throws DataException
 */
private IQueryResults populatePreparedQuery(IQueryResults outer,boolean isLeftDataSet,String dataSetName) throws DataException {
  List conditions=PreparedJointDataSourceQuery.this.dataSet.getJoinConditions();
  QueryDefinition queryDefinition=new QueryDefinition();
  queryDefinition.setDataSetName(dataSetName);
  setParameterBindings(dataEngine,dataSetName,isLeftDataSet,queryDefinition);
  for (int i=0; i < conditions.size(); i++) {
    addSortToQuery((IJoinCondition)conditions.get(i),isLeftDataSet,queryDefinition);
  }
  IPreparedQuery preparedQuery=PreparedQueryUtil.newInstance(dataEngine,queryDefinition,appContext);
  try {
    return preparedQuery.execute(outer,null);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 72622
Project: 72622
Buggy source:
protected IQuery createOdiQuery() throws DataException {
  setCurrentDataSet(dataSetDesign);
  try {
    populatePreparedQuery();
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  initializeResultClass(dataEngine,appContext);
  return new JointDataSetQuery(resultClass);
}

Fixed version (ground truth):
protected IQuery createOdiQuery() throws DataException {
  setCurrentDataSet(dataSetDesign);
  try {
    populatePreparedQuery(this.tabularOuterResults == null ? null : (IQueryResults)this.tabularOuterResults);
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  initializeResultClass(dataEngine,appContext);
  return new JointDataSetQuery(resultClass);
}
Program: 72623
Project: 72623
Buggy source:
/** 
 * @return
 */
public String nextID(){
  String k=QURE_ID_PREFIX + (currentId++);
  System.out.println(k);
  return k;
}

Fixed version (ground truth):
/** 
 * @return
 */
public String nextID(){
  return QURE_ID_PREFIX + (currentId++);
}
Program: 72624
Project: 72624
Buggy source:
private String getDriverClassPath(){
  return (this.appContext != null && this.appContext.get(IConnectionFactory.DRIVER_CLASSPATH) != null) ? this.appContext.get(IConnectionFactory.DRIVER_CLASSPATH).toString() : null;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Collection<String> getDriverClassPath(){
  if (this.appContext == null)   return null;
  if (this.appContext.get(IConnectionFactory.DRIVER_CLASSPATH) == null)   return null;
  Object classPath=this.appContext.get(IConnectionFactory.DRIVER_CLASSPATH);
  if (classPath instanceof String) {
    ArrayList<String> result=new ArrayList<String>();
    result.add(classPath.toString());
    return result;
  }
 else   if (classPath instanceof Collection) {
    ArrayList<String> result=new ArrayList<String>();
    for (    Object aClassPath : (Collection)classPath) {
      if (aClassPath != null)       result.add(aClassPath.toString());
    }
    return result;
  }
  return null;
}
Program: 72625
Project: 72625
Buggy source:
/** 
 * Look for the Driver from drivers directory if it not in plugin class path
 * @param className
 * @return Driver instance
 * @throws OdaException 
 */
private Driver findDriver(String className,String driverClassPath) throws OdaException {
  Class driverClass=null;
  try {
    driverClass=Class.forName(className);
    logger.info("String_Node_Str" + className);
  }
 catch (  ClassNotFoundException e) {
    if (logger.isLoggable(Level.FINE)) {
      logger.info("String_Node_Str" + className + "String_Node_Str");
    }
    driverClass=loadExtraDriver(className,true,driverClassPath);
    if (driverClass == null) {
      logger.warning("String_Node_Str" + className);
      throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
    }
  }
  Driver driver=null;
  try {
    driver=(Driver)driverClass.newInstance();
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + className,e);
    throw new JDBCException(ResourceConstants.CANNOT_INSTANTIATE_DRIVER,null,className);
  }
  return driver;
}

Fixed version (ground truth):
/** 
 * Look for the Driver from drivers directory if it not in plugin class path
 * @param className
 * @return Driver instance
 * @throws OdaException 
 */
private Driver findDriver(String className,Collection<String> driverClassPath) throws OdaException {
  Class driverClass=null;
  try {
    driverClass=Class.forName(className);
    logger.info("String_Node_Str" + className);
  }
 catch (  ClassNotFoundException e) {
    if (logger.isLoggable(Level.FINE)) {
      logger.info("String_Node_Str" + className + "String_Node_Str");
    }
    driverClass=loadExtraDriver(className,true,driverClassPath);
    if (driverClass == null) {
      logger.warning("String_Node_Str" + className);
      throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
    }
  }
  Driver driver=null;
  try {
    driver=(Driver)driverClass.newInstance();
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str" + className,e);
    throw new JDBCException(ResourceConstants.CANNOT_INSTANTIATE_DRIVER,null,className);
  }
  return driver;
}
Program: 72626
Project: 72626
Buggy source:
/** 
 * Search driver in the "drivers" directory and load it if found
 * @param className
 * @return
 * @throws OdaException 
 * @throws DriverException
 * @throws OdaException
 */
private Class loadExtraDriver(String className,boolean refreshUrlsWhenFail,String driverClassPath) throws OdaException {
}

Fixed version (ground truth):
/** 
 * Search driver in the "drivers" directory and load it if found
 * @param className
 * @return
 * @throws OdaException 
 * @throws DriverException
 * @throws OdaException
 */
private Class loadExtraDriver(String className,boolean refreshUrlsWhenFail,Collection<String> driverClassPath) throws OdaException {
}
Program: 72628
Project: 72628
Buggy source:
/** 
 * Gets a JDBC connection from the specified JNDI data source URL, or if not available, directly from the specified driver and JDBC driver url.
 * @param driverClass   the class name of JDBC driver
 * @param url           JDBC connection URL
 * @param jndiNameUrl   the JNDI name to look up a Data Source name service; may be null or empty
 * @param connectionProperties  properties for establising connection
 * @return              a JDBC connection
 * @throws SQLException
 * @throws OdaException
 */
public Connection getConnection(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,String driverClassPath) throws SQLException, OdaException {
  validateConnectionUrl(url,jndiNameUrl);
  if (logger.isLoggable(Level.FINE))   logger.fine("String_Node_Str" + driverClass + "String_Node_Str"+ url+ "String_Node_Str"+ jndiNameUrl);
  return doConnect(driverClass,url,jndiNameUrl,connectionProperties,driverClassPath);
}

Fixed version (ground truth):
/** 
 * Gets a JDBC connection from the specified JNDI data source URL, or if not available, directly from the specified driver and JDBC driver url.
 * @param driverClass   the class name of JDBC driver
 * @param url           JDBC connection URL
 * @param jndiNameUrl   the JNDI name to look up a Data Source name service; may be null or empty
 * @param connectionProperties  properties for establising connection
 * @return              a JDBC connection
 * @throws SQLException
 * @throws OdaException
 */
public Connection getConnection(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,Collection<String> driverClassPath) throws SQLException, OdaException {
  validateConnectionUrl(url,jndiNameUrl);
  if (logger.isLoggable(Level.FINE))   logger.fine("String_Node_Str" + driverClass + "String_Node_Str"+ url+ "String_Node_Str"+ jndiNameUrl);
  return doConnect(driverClass,url,jndiNameUrl,connectionProperties,driverClassPath);
}
Program: 72629
Project: 72629
Buggy source:
/** 
 * Implementation of getConnection() methods. Gets connection from either java.sql.DriverManager,  or from IConnectionFactory defined in the extension
 */
private synchronized Connection doConnect(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,String driverClassPath) throws SQLException, OdaException {
  assert(url != null);
  IConnectionFactory factory=getDriverConnectionFactory(driverClass);
  if (factory != null) {
    if (logger.isLoggable(Level.FINER))     logger.finer("String_Node_Str" + driverClass + "String_Node_Str"+ url);
    return factory.getConnection(driverClass,url,connectionProperties);
  }
  Connection jndiDSConnection=getJndiDSConnection(driverClass,jndiNameUrl,connectionProperties);
  if (jndiDSConnection != null)   return jndiDSConnection;
  loadAndRegisterDriver(driverClass,driverClassPath);
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + url);
  try {
    return DriverManager.getConnection(url,connectionProperties);
  }
 catch (  Exception e) {
    throw new JDBCException(ResourceConstants.CONN_GET_ERROR,null,truncate(e.getLocalizedMessage()));
  }
}

Fixed version (ground truth):
/** 
 * Implementation of getConnection() methods. Gets connection from either java.sql.DriverManager,  or from IConnectionFactory defined in the extension
 */
private synchronized Connection doConnect(String driverClass,String url,String jndiNameUrl,Properties connectionProperties,Collection<String> driverClassPath) throws SQLException, OdaException {
  assert(url != null);
  IConnectionFactory factory=getDriverConnectionFactory(driverClass);
  if (factory != null) {
    if (logger.isLoggable(Level.FINER))     logger.finer("String_Node_Str" + driverClass + "String_Node_Str"+ url);
    return factory.getConnection(driverClass,url,connectionProperties);
  }
  Connection jndiDSConnection=getJndiDSConnection(driverClass,jndiNameUrl,connectionProperties);
  if (jndiDSConnection != null)   return jndiDSConnection;
  loadAndRegisterDriver(driverClass,driverClassPath);
  if (logger.isLoggable(Level.FINER))   logger.finer("String_Node_Str" + url);
  try {
    return DriverManager.getConnection(url,connectionProperties);
  }
 catch (  Exception e) {
    throw new JDBCException(ResourceConstants.CONN_GET_ERROR,null,truncate(e.getLocalizedMessage()));
  }
}
Program: 72630
Project: 72630
Buggy source:
public DriverClassLoader(String driverClassPath) throws OdaException {
  super(new URL[0],DriverClassLoader.class.getClassLoader());
  logger.entering(DriverClassLoader.class.getName(),"String_Node_Str");
  this.driverClassPath=driverClassPath;
  bundle=Platform.getBundle("String_Node_Str");
  if (bundle == null) {
    logger.severe("String_Node_Str");
  }
 else {
    refreshURLs();
  }
}

Fixed version (ground truth):
public DriverClassLoader(Collection<String> driverClassPath) throws OdaException {
  super(new URL[0],DriverClassLoader.class.getClassLoader());
  logger.entering(DriverClassLoader.class.getName(),"String_Node_Str");
  this.driverClassPath=driverClassPath;
  bundle=Platform.getBundle("String_Node_Str");
  if (bundle == null) {
    logger.severe("String_Node_Str");
  }
 else {
    refreshURLs();
  }
}
Program: 72631
Project: 72631
Buggy source:
public void loadAndRegisterDriver(String className,String driverClassPath) throws OdaException {
  if (className == null || className.length() == 0)   return;
  if (isDeregistered(className)) {
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
 else   if (this.registeredDrivers.containsKey(className)) {
    return;
  }
  if (logger.isLoggable(Level.INFO)) {
    logger.info("String_Node_Str" + className);
  }
  Driver driver=findDriver(className,driverClassPath);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.put(className,DRIVER_REGISTERED);
}

Fixed version (ground truth):
public void loadAndRegisterDriver(String className,Collection<String> driverClassPath) throws OdaException {
  if (className == null || className.length() == 0)   return;
  if (isDeregistered(className)) {
    throw new JDBCException(ResourceConstants.CANNOT_LOAD_DRIVER,null,className);
  }
 else   if (this.registeredDrivers.containsKey(className)) {
    return;
  }
  if (logger.isLoggable(Level.INFO)) {
    logger.info("String_Node_Str" + className);
  }
  Driver driver=findDriver(className,driverClassPath);
  if (driver != null) {
    try {
      if (logger.isLoggable(Level.FINER))       logger.finer("String_Node_Str" + className);
      DriverManager.registerDriver(new WrappedDriver(driver,className));
    }
 catch (    SQLException e) {
      logger.log(Level.WARNING,"String_Node_Str",e);
    }
  }
  registeredDrivers.put(className,DRIVER_REGISTERED);
}
Program: 72632
Project: 72632
Buggy source:
/** 
 * save the design into the stream.
 * @param design design handler
 */
public ReportRunnable saveDesign(ReportRunnable runnable,ReportRunnable originalRunnable){
  RAOutputStream out=null;
  ReportRunnable newRunnable=runnable;
  try {
    if (originalRunnable != null && runnable != originalRunnable) {
      ReportDesignHandle design=runnable.getReport();
      out=archive.createRandomAccessStream(ORIGINAL_DESIGN_STREAM);
      DocumentUtil.serialize(design,out);
    }
    ReportDesignHandle design=runnable.getReport();
    out=archive.createRandomAccessStream(DESIGN_STREAM);
    ReportDesignHandle newDesign=DocumentUtil.serialize(design,out);
    designName=design.getFileName();
    newRunnable=new ReportRunnable(newDesign);
    newRunnable.setReportEngine(engine);
    newRunnable.setReportName(runnable.getReportName());
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
    out=null;
  }
  return newRunnable;
}

Fixed version (ground truth):
/** 
 * save the design into the stream.
 * @param design design handler
 */
public ReportRunnable saveDesign(ReportRunnable runnable,ReportRunnable originalRunnable){
  RAOutputStream out=null;
  ReportRunnable newRunnable=runnable;
  try {
    if (originalRunnable != null && runnable != originalRunnable) {
      ReportDesignHandle design=runnable.getReport();
      out=archive.createRandomAccessStream(ORIGINAL_DESIGN_STREAM);
      DocumentUtil.serialize(design,out);
      out.close();
    }
    ReportDesignHandle design=runnable.getReport();
    out=archive.createRandomAccessStream(DESIGN_STREAM);
    ReportDesignHandle newDesign=DocumentUtil.serialize(design,out);
    designName=design.getFileName();
    newRunnable=new ReportRunnable(newDesign);
    newRunnable.setReportEngine(engine);
    newRunnable.setReportName(runnable.getReportName());
  }
 catch (  Exception ex) {
    logger.log(Level.SEVERE,"String_Node_Str",ex);
  }
 finally {
    if (out != null) {
      try {
        out.close();
      }
 catch (      Exception ex) {
      }
    }
    out=null;
  }
  return newRunnable;
}
Program: 72633
Project: 72633
Buggy source:
public void dispose(){
  super.dispose();
  if (browser != null && !browser.isDisposed()) {
    WebViewer.cancel(browser);
  }
  bParameter=null;
  browser=null;
  model=null;
}

Fixed version (ground truth):
public void dispose(){
  super.dispose();
  if (browser != null && !browser.isDisposed()) {
    WebViewer.cancel(browser);
    browser.stop();
  }
  bParameter=null;
  browser=null;
  model=null;
}
Program: 72634
Project: 72634
Buggy source:
/** 
 * handle something when try to leave the page
 */
public void handleLeaveThePage(){
  if (browser != null && !browser.isDisposed()) {
    WebViewer.cancel(browser);
    browser.setUrl("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * handle something when try to leave the page
 */
public void handleLeaveThePage(){
  if (browser != null && !browser.isDisposed()) {
    WebViewer.cancel(browser);
    browser.stop();
    browser.setUrl("String_Node_Str");
  }
}
Program: 72636
Project: 72636
Buggy source:
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  Context cx=Context.enter();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(cx);
  }
  new CoreJavaScriptInitializer().initialize(cx,scope);
  Context.exit();
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param engine
 */
public DataEngineSession(DataEngineImpl engine){
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  Context cx=Context.enter();
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(cx);
  }
  new CoreJavaScriptInitializer().initialize(cx,scope);
  Context.exit();
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  this.queryResultIDUtil=new QueryResultIDUtil();
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}
Program: 72637
Project: 72637
Buggy source:
public String getID(){
  if (queryResultID == null)   queryResultID=QueryResultIDUtil.nextID();
  return queryResultID;
}

Fixed version (ground truth):
public String getID(){
  if (queryResultID == null)   queryResultID=session.getQueryResultIDUtil().nextID();
  return queryResultID;
}
Program: 72638
Project: 72638
Buggy source:
/** 
 * @return
 * @throws BirtException 
 */
private IResultIterator execSubQuery(String parentQueryResultID,String name,Scriptable scope,Scriptable parentScope) throws BirtException {
  Object ob=subQueryMap.get(name);
  if (ob == null)   return null;
  PreparedDummyQuery preparedQuery=new PreparedDummyQuery(context,(ISubqueryDefinition)ob,scope);
  preparedQuery.subQueryName=name;
  preparedQuery.subQueryIndex=0;
  QueryResults queryResults=(QueryResults)preparedQuery.executeQuery(scope,parentScope);
  queryResults.setID(parentQueryResultID);
  return queryResults.getResultIterator();
}

Fixed version (ground truth):
/** 
 * @return
 * @throws BirtException 
 */
private IResultIterator execSubQuery(String parentQueryResultID,String name,Scriptable scope,Scriptable parentScope) throws BirtException {
  Object ob=subQueryMap.get(name);
  if (ob == null)   return null;
  PreparedDummyQuery preparedQuery=new PreparedDummyQuery((ISubqueryDefinition)ob,session);
  preparedQuery.subQueryName=name;
  preparedQuery.subQueryIndex=0;
  QueryResults queryResults=(QueryResults)preparedQuery.executeQuery(scope,parentScope);
  queryResults.setID(parentQueryResultID);
  return queryResults.getResultIterator();
}
Program: 72639
Project: 72639
Buggy source:
/** 
 * @param context
 * @param subQueryDefn
 * @param sharedScope
 */
PreparedDummyQuery(DataEngineContext context,ISubqueryDefinition subQueryDefn,Scriptable sharedScope){
  Object[] params={context,subQueryDefn,sharedScope};
  logger.entering(PreparedDummyQuery.class.getName(),"String_Node_Str",params);
  this.subQueryDefn=subQueryDefn;
  init(context,subQueryDefn,sharedScope);
  logger.exiting(PreparedDummyQuery.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param context
 * @param subQueryDefn
 * @param sharedScope
 */
PreparedDummyQuery(ISubqueryDefinition subQueryDefn,DataEngineSession session){
  Object[] params={subQueryDefn,session};
  logger.entering(PreparedDummyQuery.class.getName(),"String_Node_Str",params);
  this.subQueryDefn=subQueryDefn;
  this.session=session;
  init(session.getEngineContext(),subQueryDefn,session.getSharedScope());
  logger.exiting(PreparedDummyQuery.class.getName(),"String_Node_Str");
}
Program: 72640
Project: 72640
Buggy source:
/** 
 * @return
 */
private RDSaveUtil getRdSaveUtil(){
  if (this.rdSaveUtil == null) {
    rdSaveUtil=new RDSaveUtil(context,queryDefn,queryResults.getID());
  }
  return this.rdSaveUtil;
}

Fixed version (ground truth):
/** 
 * @return
 */
private RDSaveUtil getRdSaveUtil(){
  if (this.rdSaveUtil == null) {
    rdSaveUtil=new RDSaveUtil(session.getEngineContext(),queryDefn,queryResults.getID());
  }
  return this.rdSaveUtil;
}
Program: 72641
Project: 72641
Buggy source:
/** 
 * Return the QueryResults. But the execution of query would be deferred
 * @param outerResults If query is nested within another query, this is the outer query's query result handle.
 * @param scope The ElementState object for the report item using the query; this acts as the JS scope for evaluating script expressions.
 * @param executor
 * @parem dataSourceQuery
 */
QueryResults doPrepare(IBaseQueryResults outerResults,Scriptable scope,QueryExecutor executor,PreparedDataSourceQuery dataSourceQuery) throws DataException {
  if (this.baseQueryDefn == null) {
    DataException e=new DataException(ResourceConstants.PREPARED_QUERY_CLOSED);
    logger.logp(Level.WARNING,PreparedQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  executor.setAppContext(this.appContext);
  logger.finer("String_Node_Str");
  executor.prepareExecution(outerResults,scope);
  logger.finer("String_Node_Str");
  QueryResults result=new QueryResults(new ServiceForQueryResults(this.session,executor.getQueryScope(),executor.getNestedLevel() + 1,dataSourceQuery,queryService,executor,this.baseQueryDefn,this.exprManager));
  if (this.baseQueryDefn.cacheQueryResults()) {
    result.setID(QueryResultIDUtil.nextID());
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Return the QueryResults. But the execution of query would be deferred
 * @param outerResults If query is nested within another query, this is the outer query's query result handle.
 * @param scope The ElementState object for the report item using the query; this acts as the JS scope for evaluating script expressions.
 * @param executor
 * @parem dataSourceQuery
 */
QueryResults doPrepare(IBaseQueryResults outerResults,Scriptable scope,QueryExecutor executor,PreparedDataSourceQuery dataSourceQuery) throws DataException {
  if (this.baseQueryDefn == null) {
    DataException e=new DataException(ResourceConstants.PREPARED_QUERY_CLOSED);
    logger.logp(Level.WARNING,PreparedQuery.class.getName(),"String_Node_Str","String_Node_Str",e);
    throw e;
  }
  executor.setAppContext(this.appContext);
  logger.finer("String_Node_Str");
  executor.prepareExecution(outerResults,scope);
  logger.finer("String_Node_Str");
  QueryResults result=new QueryResults(new ServiceForQueryResults(this.session,executor.getQueryScope(),executor.getNestedLevel() + 1,dataSourceQuery,queryService,executor,this.baseQueryDefn,this.exprManager));
  if (this.baseQueryDefn.cacheQueryResults()) {
    result.setID(this.session.getQueryResultIDUtil().nextID());
  }
  return result;
}
Program: 72642
Project: 72642
Buggy source:
public IResultIterator getSecondaryIterator(String subQueryName,Scriptable subScope) throws DataException {
  Collection subQueries=this.getQueryResults().getPreparedQuery().getReportQueryDefn().getSubqueries();
  Iterator subIt=subQueries.iterator();
  HashMap subQueryMap=new HashMap();
  while (subIt.hasNext()) {
    ISubqueryDefinition subquery=(ISubqueryDefinition)subIt.next();
    subQueryMap.put(subquery.getName(),subquery);
  }
  PreparedDummyQuery preparedQuery=new PreparedDummyQuery(session.getEngineContext(),((ISubqueryDefinition)subQueryMap.get(subQueryName)),subScope);
  IQueryResults queryResults;
  try {
    queryResults=(IQueryResults)preparedQuery.executeQuery(subScope,subScope);
    return queryResults.getResultIterator();
  }
 catch (  BirtException e) {
    throw new DataException(e.getMessage());
  }
}

Fixed version (ground truth):
public IResultIterator getSecondaryIterator(String subQueryName,Scriptable subScope) throws DataException {
  Collection subQueries=this.getQueryResults().getPreparedQuery().getReportQueryDefn().getSubqueries();
  Iterator subIt=subQueries.iterator();
  HashMap subQueryMap=new HashMap();
  while (subIt.hasNext()) {
    ISubqueryDefinition subquery=(ISubqueryDefinition)subIt.next();
    subQueryMap.put(subquery.getName(),subquery);
  }
  PreparedDummyQuery preparedQuery=new PreparedDummyQuery(((ISubqueryDefinition)subQueryMap.get(subQueryName)),session);
  IQueryResults queryResults;
  try {
    queryResults=(IQueryResults)preparedQuery.executeQuery(subScope,subScope);
    return queryResults.getResultIterator();
  }
 catch (  BirtException e) {
    throw new DataException(e.getMessage());
  }
}
Program: 72643
Project: 72643
Buggy source:
public String getID(){
  if (selfQueryResultID == null)   selfQueryResultID=QueryResultIDUtil.nextID();
  return QueryResultIDUtil.buildID(rootQueryResultID,selfQueryResultID);
}

Fixed version (ground truth):
public String getID(){
  if (selfQueryResultID == null)   selfQueryResultID=this.session.getQueryResultIDUtil().nextID();
  return QueryResultIDUtil.buildID(rootQueryResultID,selfQueryResultID);
}
Program: 72644
Project: 72644
Buggy source:
/** 
 * @return save util used in report document GENERATION time
 */
private RDSaveHelper getRdSaveHelper(){
  if (this.rdSaveHelper == null) {
    rdSaveHelper=new RDSaveHelper(this.resultService.getSession().getEngineContext(),this.resultService.getQueryDefn(),this.odiResult,new IDInfo(this.resultService.getQueryResults().getID()));
  }
  return this.rdSaveHelper;
}

Fixed version (ground truth):
/** 
 * @return save util used in report document GENERATION time
 * @throws DataException 
 */
private RDSaveHelper getRdSaveHelper() throws DataException {
  if (this.rdSaveHelper == null) {
    IDInfo id=null;
    if (this.resultService.getQueryDefn() instanceof ISubqueryDefinition) {
      id=new IDInfo(null,this.resultService.getQueryDefn().getName());
    }
 else {
      id=new IDInfo(this.resultService.getQueryResults().getID());
    }
    rdSaveHelper=new RDSaveHelper(this.resultService.getSession().getEngineContext(),this.resultService.getQueryDefn(),this.odiResult,id);
  }
  return this.rdSaveHelper;
}
Program: 72645
Project: 72645
Buggy source:
/** 
 * @param streamManager
 * @return
 * @throws DataException
 */
public static String getNextID(DataEngineContext context,String rootQueryResultID) throws DataException {
  StreamManager streamManager=new StreamManager(context,new QueryResultInfo(rootQueryResultID,null,-1));
  Set idSet=getIDMap(streamManager).keySet();
  String queryID=null;
  while (true) {
    queryID=QueryResultIDUtil.nextID();
    if (idSet.contains(queryID) == false)     break;
  }
  return queryID;
}

Fixed version (ground truth):
/** 
 * @param streamManager
 * @return
 * @throws DataException
 */
public static String getNextID(DataEngineSession session,String rootQueryResultID) throws DataException {
  StreamManager streamManager=new StreamManager(session.getEngineContext(),new QueryResultInfo(rootQueryResultID,null,-1));
  Set idSet=getIDMap(streamManager).keySet();
  String queryID=null;
  while (true) {
    queryID=session.getQueryResultIDUtil().nextID();
    if (idSet.contains(queryID) == false)     break;
  }
  return queryID;
}
Program: 72646
Project: 72646
Buggy source:
/** 
 * @return
 */
public static String nextID(){
  int id=((Integer)qursStart.get()).intValue();
  qursStart.set(new Integer(id + 1));
  return QURE_ID_PREFIX + (id);
}

Fixed version (ground truth):
/** 
 * @return
 */
public String nextID(){
  String k=QURE_ID_PREFIX + (currentId++);
  System.out.println(k);
  return k;
}
Program: 72647
Project: 72647
Buggy source:
/** 
 * No instance
 */
private QueryResultIDUtil(){
}

Fixed version (ground truth):
/** 
 * No instance
 */
public QueryResultIDUtil(){
}
Program: 72649
Project: 72649
Buggy source:
public Object getAdater(Object adaptableObject){
  if (this.adapter != null && this.isSingleton) {
    return this.adapter;
  }
  if (this.adapterInstance != null) {
    return this.adapter=this.adapterInstance;
  }
  if (this.factory != null) {
    this.adapter=this.factory.getAdapter(adaptableObject,this.adapterType);
  }
  if (this.adapter == null && this.includeWorkbenchContribute) {
    this.adapter=Platform.getAdapterManager().getAdapter(adaptableObject,this.adapterType);
  }
  return adapter;
}

Fixed version (ground truth):
public Object getAdater(Object adaptableObject){
  if (this.adapter != null && this.isSingleton) {
    return this.adapter;
  }
  if (this.adapterInstance != null) {
    return this.adapterInstance;
  }
  Object apt=null;
  if (this.factory != null) {
    apt=this.factory.getAdapter(adaptableObject,this.adapterType);
  }
  if (apt == null && this.includeWorkbenchContribute) {
    apt=Platform.getAdapterManager().getAdapter(adaptableObject,this.adapterType);
  }
  if (this.isSingleton) {
    this.adapter=apt;
  }
  return apt;
}
Program: 72650
Project: 72650
Buggy source:
public void testIrr(){
  double a[]=new double[]{-70000,12000,15000};
  Object jsNumber=Context.javaToJS(a,scope);
  ScriptableObject.putProperty(scope,"String_Node_Str",jsNumber);
  String script4="String_Node_Str";
  double value4=eval(script4);
  assertEquals(-0.44,value4,0.01);
  String script1="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  double value1=eval(script1);
  assertEquals(0.0866,value1,0.0001);
  String script2="String_Node_Str";
  double value2=eval(script2);
  assertEquals(-0.021244848272999998,value2,Double.MIN_VALUE);
  String script3="String_Node_Str";
  double value3=eval(script3);
  assertEquals(-0.44,value3,0.01);
  assertFalse(hasException);
}

Fixed version (ground truth):
public void testIrr(){
  double a[]=new double[]{-70000,12000,15000};
  Object jsNumber=Context.javaToJS(a,scope);
  ScriptableObject.putProperty(scope,"String_Node_Str",jsNumber);
  String script4="String_Node_Str";
  double value4=eval(script4);
  assertEquals(-0.44,value4,0.01);
  String script1="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
  double value1=eval(script1);
  assertEquals(0.0866,value1,0.0001);
  String script2="String_Node_Str";
  double value2=eval(script2);
  assertEquals(-0.021244848273899997,value2,Double.MIN_VALUE);
  String script3="String_Node_Str";
  double value3=eval(script3);
  assertEquals(-0.44,value3,0.01);
  assertFalse(hasException);
}
Program: 72651
Project: 72651
Buggy source:
public void partClosed(IWorkbenchPart part){
  if (part == this && getModel() != null) {
    SessionHandleAdapter.getInstance().clear(getModel());
  }
}

Fixed version (ground truth):
public void partClosed(IWorkbenchPart part){
  if (part == this && getModel() != null) {
    SessionHandleAdapter.getInstance().clear(getModel());
    if (getModel() != null) {
      GlobalActionFactory.removeStackActions(getModel().getCommandStack());
    }
  }
}