Program: 73719
Project: 73719
Buggy source:
/** 
 * Update a collection of models in the cache.  If a model is not in the cache, add it.  If it is, update it.
 * @param assemblies A HashMap that maps a collection of models names to  their respective MoML strings.  These are the models to be  updated in the cache.
 * @exception DBConnectionException Thrown if a problem occurs with the cache connection.
 * @exception DBExecutionException Thrown if a problem occurs updating the cache.
 */
public static void updateCache(HashMap assemblies) throws DBConnectionException, DBExecutionException {
  DBConnection dbConnection=null;
  try {
    if (assemblies == null) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
    }
    dbConnection=DBConnectorFactory.getCacheConnection(true);
    Iterator iterator=assemblies.keySet().iterator();
    while (iterator.hasNext()) {
      String modelName=(String)iterator.next();
      XMLDBModel cacheModel=new XMLDBModel(modelName);
      cacheModel.setModel((String)assemblies.get(modelName));
      try {
        CreateModelTask createModelTask=new CreateModelTask(cacheModel);
        dbConnection.executeCreateModelTask(createModelTask);
      }
 catch (      ModelAlreadyExistException e) {
        SaveModelTask saveModelTask=new SaveModelTask(cacheModel);
        dbConnection.executeSaveModelTask(saveModelTask);
      }
    }
  }
 catch (  DBExecutionException e) {
    if (dbConnection != null) {
      dbConnection.abortConnection();
    }
    throw new DBExecutionException("String_Node_Str" + e.getMessage(),e);
  }
 finally {
    if (dbConnection != null) {
      dbConnection.closeConnection();
    }
  }
}

Fixed version (ground truth):
/** 
 * Update a collection of models in the cache.  If a model is not in the cache, add it.  If it is, update it.
 * @param assemblies A HashMap that maps a collection of models names to  their respective MoML strings.  These are the models to be  updated in the cache.
 * @exception DBConnectionException Thrown if a problem occurs with the cache connection.
 * @exception DBExecutionException Thrown if a problem occurs updating the cache.
 */
public static void updateCache(HashMap assemblies) throws DBConnectionException, DBExecutionException {
  DBConnection dbConnection=null;
  try {
    if (assemblies == null) {
      throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
    }
    dbConnection=DBConnectorFactory.getCacheConnection(true);
    if (dbConnection == null) {
      throw new DBConnectionException("String_Node_Str");
    }
    Iterator iterator=assemblies.keySet().iterator();
    while (iterator.hasNext()) {
      String modelName=(String)iterator.next();
      XMLDBModel cacheModel=new XMLDBModel(modelName);
      cacheModel.setModel((String)assemblies.get(modelName));
      try {
        CreateModelTask createModelTask=new CreateModelTask(cacheModel);
        dbConnection.executeCreateModelTask(createModelTask);
      }
 catch (      ModelAlreadyExistException e) {
        SaveModelTask saveModelTask=new SaveModelTask(cacheModel);
        dbConnection.executeSaveModelTask(saveModelTask);
      }
    }
    dbConnection.commitConnection();
  }
 catch (  DBExecutionException e) {
    if (dbConnection != null) {
      dbConnection.abortConnection();
    }
    throw new DBExecutionException("String_Node_Str" + e.getMessage(),e);
  }
 finally {
    if (dbConnection != null) {
      dbConnection.closeConnection();
    }
  }
}