Program: 65721
Project: 65721
Buggy source:
public void shutdown(){
  logger.entering("String_Node_Str","String_Node_Str");
  if (dataSources == null) {
    logger.fine("String_Node_Str");
    return;
  }
  Collection col=dataSources.values();
  Iterator it=col.iterator();
  while (it.hasNext()) {
    DataSourceRuntime ds=(DataSourceRuntime)it.next();
    try {
      closeDataSource(ds);
    }
 catch (    DataException e) {
      if (logger.isLoggable(Level.FINER))       logger.log(Level.FINER,"String_Node_Str" + ds + "String_Node_Str",e);
    }
  }
  this.dataSourceManager.close();
  releaseValidationContexts();
  if (shutdownListenerList != null) {
    for (int i=0; i < shutdownListenerList.size(); i++) {
      ((IShutdownListener)shutdownListenerList.get(i)).dataEngineShutdown();
    }
    shutdownListenerList.clear();
  }
  logger.logp(Level.FINE,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str");
  dataSetDesigns=null;
  dataSources=null;
  try {
    DataEngineThreadLocal.getInstance().getCloseListener().dataEngineShutDown();
    DataEngineThreadLocal.getInstance().removeTempPathManger();
    if (DataEngineThreadLocal.getInstance().getCloseListener().getActivateDteCount() == 0) {
      DataEngineThreadLocal.getInstance().getCloseListener().closeAll();
      DataEngineThreadLocal.getInstance().removeCloseListener();
    }
    clearTempFile();
  }
 catch (  IOException e) {
  }
  if (this.getContext().getDocWriter() != null) {
    RAOutputStream outputStream;
    try {
      if (this.getContext().getDocWriter().exists(DataEngineContext.QUERY_STARTING_ID)) {
        outputStream=this.getContext().getDocWriter().getOutputStream(DataEngineContext.QUERY_STARTING_ID);
      }
 else {
        outputStream=this.getContext().getDocWriter().createOutputStream(DataEngineContext.QUERY_STARTING_ID);
      }
      outputStream.writeInt(this.getSession().getQueryResultIDUtil().getCurrentQueryId());
      outputStream.close();
    }
 catch (    IOException e) {
    }
  }
  logger.exiting(DataEngineImpl.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
public void shutdown(){
  logger.entering("String_Node_Str","String_Node_Str");
  if (dataSources == null) {
    logger.fine("String_Node_Str");
    return;
  }
  for (  DataSourceRuntime ds : dataSources.values()) {
    try {
      closeDataSource(ds);
    }
 catch (    DataException e) {
      if (logger.isLoggable(Level.FINER))       logger.log(Level.FINER,"String_Node_Str" + ds + "String_Node_Str",e);
    }
  }
  this.dataSourceManager.close();
  releaseValidationContexts();
  if (shutdownListenerSet != null) {
    for (    IShutdownListener shutdownListener : shutdownListenerSet) {
      shutdownListener.dataEngineShutdown();
    }
    shutdownListenerSet.clear();
  }
  logger.logp(Level.FINE,DataEngineImpl.class.getName(),"String_Node_Str","String_Node_Str");
  dataSetDesigns=null;
  dataSources=null;
  try {
    DataEngineThreadLocal.getInstance().getCloseListener().dataEngineShutDown();
    DataEngineThreadLocal.getInstance().removeTempPathManger();
    if (DataEngineThreadLocal.getInstance().getCloseListener().getActivateDteCount() == 0) {
      DataEngineThreadLocal.getInstance().getCloseListener().closeAll();
      DataEngineThreadLocal.getInstance().removeCloseListener();
    }
    clearTempFile();
  }
 catch (  IOException e) {
  }
  if (this.getContext().getDocWriter() != null) {
    RAOutputStream outputStream;
    try {
      if (this.getContext().getDocWriter().exists(DataEngineContext.QUERY_STARTING_ID)) {
        outputStream=this.getContext().getDocWriter().getOutputStream(DataEngineContext.QUERY_STARTING_ID);
      }
 else {
        outputStream=this.getContext().getDocWriter().createOutputStream(DataEngineContext.QUERY_STARTING_ID);
      }
      outputStream.writeInt(this.getSession().getQueryResultIDUtil().getCurrentQueryId());
      outputStream.close();
    }
 catch (    IOException e) {
    }
  }
  logger.exiting(DataEngineImpl.class.getName(),"String_Node_Str");
}