Program: 84314
Project: 84314
Buggy source:
/** 
 * This method will actually execute each of the changes in the list against the specified database.
 */
public void execute() throws DatabaseHistoryException, MigrationFailedException {
  Migrator migrator=getDatabaseChangeLog().getMigrator();
  Connection connection=migrator.getDatabase().getConnection();
  try {
    Writer outputSQLWriter=getDatabaseChangeLog().getMigrator().getOutputSQLWriter();
    if (migrator.getMode().equals(Migrator.Mode.EXECUTE_MODE)) {
      log.finest("String_Node_Str" + toString());
      for (      Change change : getChanges()) {
        change.executeStatements(migrator.getDatabase());
        log.finest(change.getConfirmationMessage());
      }
      connection.commit();
      log.finest("String_Node_Str" + toString() + "String_Node_Str");
    }
 else     if (migrator.getMode().equals(Migrator.Mode.OUTPUT_SQL_MODE)) {
      outputSQLWriter.write("String_Node_Str" + toString() + StreamUtil.getLineSeparator());
      writeComments(outputSQLWriter);
      for (      Change change : getChanges()) {
        change.saveStatements(getDatabaseChangeLog().getMigrator().getDatabase(),outputSQLWriter);
      }
    }
 else     if (migrator.getMode().equals(Migrator.Mode.EXECUTE_ROLLBACK_MODE)) {
      log.finest("String_Node_Str" + toString());
      if (rollBackStatements != null && rollBackStatements.length > 0) {
        Statement statement=connection.createStatement();
        for (        String rollback : rollBackStatements) {
          try {
            statement.execute(rollback);
          }
 catch (          SQLException e) {
            throw new RollbackFailedException("String_Node_Str" + rollback + "String_Node_Str");
          }
        }
        statement.close();
      }
 else {
        List<Change> changes=getChanges();
        for (int i=changes.size() - 1; i >= 0; i--) {
          Change change=changes.get(i);
          change.executeRollbackStatements(migrator.getDatabase());
          log.finest(change.getConfirmationMessage());
        }
      }
      connection.commit();
      log.finest("String_Node_Str" + toString() + "String_Node_Str");
    }
 else     if (migrator.getMode().equals(Migrator.Mode.OUTPUT_ROLLBACK_SQL_MODE) || migrator.getMode().equals(Migrator.Mode.OUTPUT_FUTURE_ROLLBACK_SQL_MODE)) {
      outputSQLWriter.write("String_Node_Str" + toString() + StreamUtil.getLineSeparator());
      writeComments(outputSQLWriter);
      if (rollBackStatements != null && rollBackStatements.length > 0) {
        for (        String statement : rollBackStatements) {
          outputSQLWriter.append(statement + "String_Node_Str" + StreamUtil.getLineSeparator()+ StreamUtil.getLineSeparator());
        }
      }
 else {
        for (int i=changes.size() - 1; i >= 0; i--) {
          Change change=changes.get(i);
          change.saveRollbackStatement(getDatabaseChangeLog().getMigrator().getDatabase(),outputSQLWriter);
        }
      }
    }
 else     if (migrator.getMode().equals(Migrator.Mode.OUTPUT_CHANGELOG_ONLY_SQL_MODE)) {
    }
 else {
      throw new MigrationFailedException("String_Node_Str" + migrator.getMode());
    }
    connection.commit();
  }
 catch (  Exception e) {
    try {
      connection.rollback();
    }
 catch (    SQLException e1) {
      throw new MigrationFailedException("String_Node_Str" + toString() + "String_Node_Str"+ e.getMessage(),e);
    }
    throw new MigrationFailedException("String_Node_Str" + toString() + "String_Node_Str"+ e.getMessage(),e);
  }
}

Fixed version (ground truth):
/** 
 * This method will actually execute each of the changes in the list against the specified database.
 */
public void execute() throws MigrationFailedException {
  Migrator migrator=getDatabaseChangeLog().getMigrator();
  Connection connection=migrator.getDatabase().getConnection();
  try {
    Writer outputSQLWriter=getDatabaseChangeLog().getMigrator().getOutputSQLWriter();
    if (migrator.getMode().equals(Migrator.Mode.EXECUTE_MODE)) {
      log.finest("String_Node_Str" + toString());
      for (      Change change : getChanges()) {
        change.executeStatements(migrator.getDatabase());
        log.finest(change.getConfirmationMessage());
      }
      connection.commit();
      log.finest("String_Node_Str" + toString() + "String_Node_Str");
    }
 else     if (migrator.getMode().equals(Migrator.Mode.OUTPUT_SQL_MODE)) {
      outputSQLWriter.write("String_Node_Str" + toString() + StreamUtil.getLineSeparator());
      writeComments(outputSQLWriter);
      for (      Change change : getChanges()) {
        change.saveStatements(getDatabaseChangeLog().getMigrator().getDatabase(),outputSQLWriter);
      }
    }
 else     if (migrator.getMode().equals(Migrator.Mode.EXECUTE_ROLLBACK_MODE)) {
      log.finest("String_Node_Str" + toString());
      if (rollBackStatements != null && rollBackStatements.length > 0) {
        Statement statement=connection.createStatement();
        for (        String rollback : rollBackStatements) {
          try {
            statement.execute(rollback);
          }
 catch (          SQLException e) {
            throw new RollbackFailedException("String_Node_Str" + rollback + "String_Node_Str");
          }
        }
        statement.close();
      }
 else {
        List<Change> changes=getChanges();
        for (int i=changes.size() - 1; i >= 0; i--) {
          Change change=changes.get(i);
          change.executeRollbackStatements(migrator.getDatabase());
          log.finest(change.getConfirmationMessage());
        }
      }
      connection.commit();
      log.finest("String_Node_Str" + toString() + "String_Node_Str");
    }
 else     if (migrator.getMode().equals(Migrator.Mode.OUTPUT_ROLLBACK_SQL_MODE) || migrator.getMode().equals(Migrator.Mode.OUTPUT_FUTURE_ROLLBACK_SQL_MODE)) {
      outputSQLWriter.write("String_Node_Str" + toString() + StreamUtil.getLineSeparator());
      writeComments(outputSQLWriter);
      if (rollBackStatements != null && rollBackStatements.length > 0) {
        for (        String statement : rollBackStatements) {
          outputSQLWriter.append(statement + "String_Node_Str" + StreamUtil.getLineSeparator()+ StreamUtil.getLineSeparator());
        }
      }
 else {
        for (int i=changes.size() - 1; i >= 0; i--) {
          Change change=changes.get(i);
          change.saveRollbackStatement(getDatabaseChangeLog().getMigrator().getDatabase(),outputSQLWriter);
        }
      }
    }
 else     if (migrator.getMode().equals(Migrator.Mode.OUTPUT_CHANGELOG_ONLY_SQL_MODE)) {
    }
 else {
      throw new MigrationFailedException("String_Node_Str" + migrator.getMode());
    }
    connection.commit();
  }
 catch (  Exception e) {
    try {
      connection.rollback();
    }
 catch (    SQLException e1) {
      throw new MigrationFailedException("String_Node_Str" + toString() + "String_Node_Str"+ e.getMessage(),e);
    }
    throw new MigrationFailedException("String_Node_Str" + toString() + "String_Node_Str"+ e.getMessage(),e);
  }
}