Program: 65653
Project: 65653
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);
  String processName=java.lang.management.ManagementFactory.getRuntimeMXBean().getName();
  long pid=Long.parseLong(processName.split("String_Node_Str")[0]);
  tempDir=engine.getContext().getTmpdir() + "String_Node_Str" + pid+ "String_Node_Str"+ engine.hashCode()+ "String_Node_Str"+ getCount()+ File.separator;
  this.dataSetCacheManager=new DataSetCacheManager(this);
  this.cancelManager=new CancelManager();
  if (engine.getContext().getClassLoader() != null) {
    classLoaderHolder.set(engine.getContext().getClassLoader());
  }
  engine.addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      classLoaderHolder.set(null);
      houseKeepCancelManager();
      saveGeneralACL();
      if (emtpryIDStream != null)       try {
        emtpryIDStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
);
  engine.addShutdownListener(new ReportDocumentShutdownListener(this));
  this.queryResultIDUtil=new QueryResultIDUtil();
  this.loadGeneralACL();
  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");
}

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);
  StringBuffer buffer=new StringBuffer();
  buffer.append(engine.getContext().getTmpdir());
  buffer.append("String_Node_Str");
  String processName=java.lang.management.ManagementFactory.getRuntimeMXBean().getName();
  buffer.append(Integer.toHexString(processName.hashCode()));
  buffer.append("String_Node_Str");
  buffer.append(Integer.toHexString(engine.hashCode()));
  buffer.append("String_Node_Str");
  buffer.append(getCount());
  buffer.append(File.separator);
  tempDir=buffer.toString();
  this.dataSetCacheManager=new DataSetCacheManager(this);
  this.cancelManager=new CancelManager();
  if (engine.getContext().getClassLoader() != null) {
    classLoaderHolder.set(engine.getContext().getClassLoader());
  }
  engine.addShutdownListener(new IShutdownListener(){
    public void dataEngineShutdown(){
      classLoaderHolder.set(null);
      houseKeepCancelManager();
      saveGeneralACL();
      if (emtpryIDStream != null)       try {
        emtpryIDStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
);
  engine.addShutdownListener(new ReportDocumentShutdownListener(this));
  this.queryResultIDUtil=new QueryResultIDUtil();
  this.loadGeneralACL();
  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");
}