Program: 65894
Project: 65894
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().getMode() == DataEngineContext.MODE_GENERATION) {
        VersionManager vm=new VersionManager(context);
        int version=vm.getVersion();
        if (vm.getVersion() == VersionManager.VERSION_2_0) {
          version=VersionManager.getLatestVersion();
        }
        vm.setVersion(version);
      }
      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) {
    }
catch (    DataException 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;
  }
  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");
}