Program: 68193
Project: 68193
Buggy source:
/** 
 * Constructor.
 * @param engine
 * @throws BirtException 
 */
public DataEngineSession(DataEngineImpl engine) throws BirtException {
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  this.stopSign=new StopSign();
  IDataScriptEngine scriptEngine=(IDataScriptEngine)engine.getContext().getScriptContext().getScriptEngine(IDataScriptEngine.ENGINE_NAME);
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(scriptEngine.getJSContext(engine.getContext().getScriptContext()));
  }
  new CoreJavaScriptInitializer().initialize(scriptEngine.getJSContext(engine.getContext().getScriptContext()),scope);
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ "String_Node_Str"+ getCount()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  this.cancelManager=new CancelManager();
  this.currentTimer=new Timer();
  this.currentTimer.schedule(cancelManager,1000,1000);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  engine.addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      classLoaderHolder.set(null);
      houseKeepCancelManager();
    }
  }
);
  engine.addShutdownListener(new ReportDocumentShutdownListener(this));
  this.cancelManager.register(new StopSignCancellable(stopSign));
  this.queryResultIDUtil=new QueryResultIDUtil();
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param engine
 * @throws BirtException 
 */
public DataEngineSession(DataEngineImpl engine) throws BirtException {
  Object[] params={engine};
  logger.entering(DataEngineSession.class.getName(),"String_Node_Str",params);
  this.context=new HashMap();
  this.engine=engine;
  this.scope=engine.getContext().getJavaScriptScope();
  this.stopSign=new StopSign();
  IDataScriptEngine scriptEngine=(IDataScriptEngine)engine.getContext().getScriptContext().getScriptEngine(IDataScriptEngine.ENGINE_NAME);
  if (this.scope == null) {
    this.scope=new ImporterTopLevel(scriptEngine.getJSContext(engine.getContext().getScriptContext()));
  }
  new CoreJavaScriptInitializer().initialize(scriptEngine.getJSContext(engine.getContext().getScriptContext()),scope);
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + engine.hashCode()+ "String_Node_Str"+ getCount()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  this.cancelManager=new CancelManager();
  this.currentTimer=new Timer();
  this.currentTimer.schedule(cancelManager,1000,1000);
  classLoaderHolder.set(engine.getContext().getClassLoader());
  engine.addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      classLoaderHolder.set(null);
      houseKeepCancelManager();
    }
  }
);
  engine.addShutdownListener(new ReportDocumentShutdownListener(this));
  this.cancelManager.register(new StopSignCancellable(stopSign));
  int currentQueryID=0;
  if (engine.getContext().getDocReader() != null) {
    try {
      if (engine.getContext().getDocReader().exists(DataEngineContext.QUERY_STARTING_ID)) {
        RAInputStream stream=engine.getContext().getDocReader().getInputStream(DataEngineContext.QUERY_STARTING_ID);
        currentQueryID=stream.readInt();
        stream.close();
      }
    }
 catch (    IOException e) {
    }
  }
  this.queryResultIDUtil=new QueryResultIDUtil(currentQueryID);
  logger.exiting(DataEngineSession.class.getName(),"String_Node_Str");
}