Program: 84079
Project: 84079
Buggy source:
/** 
 * This method will actually execute each of the changes in the list against the specified database.
 * @return should change set be marked as ran
 */
public boolean execute(Database database) throws MigrationFailedException {
  boolean skipChange=false;
  boolean markRan=true;
  try {
    if (runInTransaction) {
      database.setAutoCommit(false);
    }
    database.getJdbcTemplate().comment("String_Node_Str" + toString());
    if (StringUtils.trimToNull(getComments()) != null) {
      String comments=getComments();
      String[] lines=comments.split("String_Node_Str");
      for (int i=0; i < lines.length; i++) {
        if (i > 0) {
          lines[i]=database.getLineComment() + "String_Node_Str" + lines[i];
        }
      }
      database.getJdbcTemplate().comment(StringUtils.join(Arrays.asList(lines),"String_Node_Str"));
    }
    if (database.getJdbcTemplate().executesStatements() && rootPrecondition != null) {
      try {
        rootPrecondition.check(database,null);
      }
 catch (      PreconditionFailedException e) {
        StringBuffer message=new StringBuffer();
        message.append(StreamUtil.getLineSeparator());
        for (        FailedPrecondition invalid : e.getFailedPreconditions()) {
          message.append("String_Node_Str").append(invalid.toString());
          message.append(StreamUtil.getLineSeparator());
        }
        if (rootPrecondition.getOnFail().equals(Preconditions.FailOption.HALT)) {
          e.printStackTrace();
          throw new MigrationFailedException(this,message.toString());
        }
 else         if (rootPrecondition.getOnFail().equals(Preconditions.FailOption.CONTINUE)) {
          skipChange=true;
          markRan=false;
          log.log(Level.INFO,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else         if (rootPrecondition.getOnFail().equals(Preconditions.FailOption.MARK_RAN)) {
          skipChange=true;
          log.log(Level.INFO,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else         if (rootPrecondition.getOnFail().equals(Preconditions.FailOption.WARN)) {
          log.log(Level.WARNING,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else {
          throw new MigrationFailedException(this,"String_Node_Str" + rootPrecondition.getOnFail());
        }
      }
catch (      PreconditionErrorException e) {
        StringBuffer message=new StringBuffer();
        message.append(StreamUtil.getLineSeparator());
        for (        ErrorPrecondition invalid : e.getErrorPreconditions()) {
          message.append("String_Node_Str").append(invalid.toString());
          message.append(StreamUtil.getLineSeparator());
        }
        if (rootPrecondition.getOnError().equals(Preconditions.ErrorOption.HALT)) {
          throw new MigrationFailedException(this,message.toString());
        }
 else         if (rootPrecondition.getOnError().equals(Preconditions.ErrorOption.CONTINUE)) {
          skipChange=true;
          markRan=false;
          log.log(Level.INFO,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else         if (rootPrecondition.getOnError().equals(Preconditions.ErrorOption.MARK_RAN)) {
          skipChange=true;
          markRan=true;
          log.log(Level.INFO,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else         if (rootPrecondition.getOnError().equals(Preconditions.ErrorOption.WARN)) {
          log.log(Level.WARNING,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else {
          throw new MigrationFailedException(this,"String_Node_Str" + rootPrecondition.getOnError());
        }
        database.rollback();
      }
    }
    if (!skipChange) {
      for (      Change change : changes) {
        try {
          change.setUp();
        }
 catch (        SetupException se) {
          throw new MigrationFailedException(this,se);
        }
      }
      log.finest("String_Node_Str" + toString());
      for (      Change change : getChanges()) {
        change.executeStatements(database,sqlVisitors);
        log.finest(change.getConfirmationMessage());
      }
      if (!runInTransaction) {
        database.commit();
      }
      log.finest("String_Node_Str" + toString() + "String_Node_Str");
      database.commit();
    }
 else {
      log.finest("String_Node_Str" + toString());
    }
  }
 catch (  Exception e) {
    try {
      database.rollback();
    }
 catch (    Exception e1) {
      throw new MigrationFailedException(this,e);
    }
    if (getFailOnError() != null && !getFailOnError()) {
      log.log(Level.INFO,"String_Node_Str" + toString(false) + "String_Node_Str",e);
    }
 else {
      if (e instanceof MigrationFailedException) {
        throw ((MigrationFailedException)e);
      }
 else {
        throw new MigrationFailedException(this,e);
      }
    }
  }
 finally {
    if (runInTransaction) {
      try {
        database.setAutoCommit(true);
      }
 catch (      JDBCException e) {
        throw new MigrationFailedException(this,"String_Node_Str");
      }
    }
  }
  return markRan;
}

Fixed version (ground truth):
/** 
 * This method will actually execute each of the changes in the list against the specified database.
 * @return should change set be marked as ran
 */
public boolean execute(Database database) throws MigrationFailedException {
  boolean skipChange=false;
  boolean markRan=true;
  try {
    database.setAutoCommit(!runInTransaction);
    database.getJdbcTemplate().comment("String_Node_Str" + toString());
    if (StringUtils.trimToNull(getComments()) != null) {
      String comments=getComments();
      String[] lines=comments.split("String_Node_Str");
      for (int i=0; i < lines.length; i++) {
        if (i > 0) {
          lines[i]=database.getLineComment() + "String_Node_Str" + lines[i];
        }
      }
      database.getJdbcTemplate().comment(StringUtils.join(Arrays.asList(lines),"String_Node_Str"));
    }
    if (database.getJdbcTemplate().executesStatements() && rootPrecondition != null) {
      try {
        rootPrecondition.check(database,null);
      }
 catch (      PreconditionFailedException e) {
        StringBuffer message=new StringBuffer();
        message.append(StreamUtil.getLineSeparator());
        for (        FailedPrecondition invalid : e.getFailedPreconditions()) {
          message.append("String_Node_Str").append(invalid.toString());
          message.append(StreamUtil.getLineSeparator());
        }
        if (rootPrecondition.getOnFail().equals(Preconditions.FailOption.HALT)) {
          e.printStackTrace();
          throw new MigrationFailedException(this,message.toString());
        }
 else         if (rootPrecondition.getOnFail().equals(Preconditions.FailOption.CONTINUE)) {
          skipChange=true;
          markRan=false;
          log.log(Level.INFO,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else         if (rootPrecondition.getOnFail().equals(Preconditions.FailOption.MARK_RAN)) {
          skipChange=true;
          log.log(Level.INFO,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else         if (rootPrecondition.getOnFail().equals(Preconditions.FailOption.WARN)) {
          log.log(Level.WARNING,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else {
          throw new MigrationFailedException(this,"String_Node_Str" + rootPrecondition.getOnFail());
        }
      }
catch (      PreconditionErrorException e) {
        StringBuffer message=new StringBuffer();
        message.append(StreamUtil.getLineSeparator());
        for (        ErrorPrecondition invalid : e.getErrorPreconditions()) {
          message.append("String_Node_Str").append(invalid.toString());
          message.append(StreamUtil.getLineSeparator());
        }
        if (rootPrecondition.getOnError().equals(Preconditions.ErrorOption.HALT)) {
          throw new MigrationFailedException(this,message.toString());
        }
 else         if (rootPrecondition.getOnError().equals(Preconditions.ErrorOption.CONTINUE)) {
          skipChange=true;
          markRan=false;
          log.log(Level.INFO,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else         if (rootPrecondition.getOnError().equals(Preconditions.ErrorOption.MARK_RAN)) {
          skipChange=true;
          markRan=true;
          log.log(Level.INFO,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else         if (rootPrecondition.getOnError().equals(Preconditions.ErrorOption.WARN)) {
          log.log(Level.WARNING,"String_Node_Str" + toString() + "String_Node_Str"+ message);
        }
 else {
          throw new MigrationFailedException(this,"String_Node_Str" + rootPrecondition.getOnError());
        }
        database.rollback();
      }
    }
    if (!skipChange) {
      for (      Change change : changes) {
        try {
          change.setUp();
        }
 catch (        SetupException se) {
          throw new MigrationFailedException(this,se);
        }
      }
      log.finest("String_Node_Str" + toString());
      for (      Change change : getChanges()) {
        change.executeStatements(database,sqlVisitors);
        log.finest(change.getConfirmationMessage());
      }
      if (runInTransaction) {
        database.commit();
      }
      log.finest("String_Node_Str" + toString() + "String_Node_Str");
    }
 else {
      log.finest("String_Node_Str" + toString());
    }
  }
 catch (  Exception e) {
    try {
      database.rollback();
    }
 catch (    Exception e1) {
      throw new MigrationFailedException(this,e);
    }
    if (getFailOnError() != null && !getFailOnError()) {
      log.log(Level.INFO,"String_Node_Str" + toString(false) + "String_Node_Str",e);
    }
 else {
      if (e instanceof MigrationFailedException) {
        throw ((MigrationFailedException)e);
      }
 else {
        throw new MigrationFailedException(this,e);
      }
    }
  }
 finally {
    if (!runInTransaction && !database.getAutoCommitMode()) {
      try {
        database.setAutoCommit(false);
      }
 catch (      JDBCException e) {
        throw new MigrationFailedException(this,"String_Node_Str");
      }
    }
  }
  return markRan;
}