Program: 143865
Project: 143865
Buggy source:
/** 
 * This operation can be used to bring the database to the latest version. First it checks which scripts were already applied to the database and executes the new scripts or the updated repeatable scripts. If an existing incremental script was changed,  removed, or if a new incremental script has been added with a lower index than one that was already executed, an error is given; unless the <fromScratch> option is enabled: in that case all database objects at the end.
 */
public void updateDatabase(){
  ScriptUpdates scriptUpdates=new ScriptUpdatesAnalyzer(scriptRepository,executedScriptInfoSource,useScriptFileLastModificationDates,allowOutOfSequenceExecutionOfPatchScripts).calculateScriptUpdates();
  if (!getIndexedScriptsThatFailedDuringLastUpdate().isEmpty()) {
    if (!scriptUpdates.hasIrregularScriptUpdates()) {
      throw new DbMaintainException("String_Node_Str" + getIndexedScriptsThatFailedDuringLastUpdate().first() + "String_Node_Str"+ "String_Node_Str");
    }
  }
  if (scriptUpdates.isEmpty()) {
    logger.info("String_Node_Str");
    return;
  }
  boolean recreateFromScratch=false;
  if (fromScratchEnabled && !hasItemsToPreserve && isInitialDatabaseUpdate()) {
    logger.info("String_Node_Str");
    recreateFromScratch=true;
  }
  if (scriptUpdates.hasIrregularScriptUpdates()) {
    if (fromScratchEnabled) {
      logger.info("String_Node_Str" + formatIrregularUpdates(scriptUpdates));
      recreateFromScratch=true;
    }
 else {
      throw new DbMaintainException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + formatIrregularUpdates(scriptUpdates) + "String_Node_Str");
    }
  }
  if (recreateFromScratch) {
    clearDatabase();
    executeScripts(scriptRepository.getAllUpdateScripts());
  }
 else {
    logger.info("String_Node_Str" + formatRegularUpdates(scriptUpdates));
    if (cleanDbEnabled) {
      dbCleaner.cleanDatabase();
    }
    executeScriptUpdates(scriptUpdates.getRegularPatchScriptUpdates());
    executeScriptUpdates(scriptUpdates.getRegularScriptUpdates());
  }
  executeScripts(scriptRepository.getPostProcessingScripts());
  if (disableConstraintsEnabled) {
    constraintsDisabler.disableConstraints();
  }
  if (updateSequencesEnabled) {
    sequenceUpdater.updateSequences();
  }
}

Fixed version (ground truth):
/** 
 * This operation can be used to bring the database to the latest version. First it checks which scripts were already applied to the database and executes the new scripts or the updated repeatable scripts. If an existing incremental script was changed,  removed, or if a new incremental script has been added with a lower index than one that was already executed, an error is given; unless the <fromScratch> option is enabled: in that case all database objects at the end.
 */
public void updateDatabase(){
  ScriptUpdates scriptUpdates=new ScriptUpdatesAnalyzer(scriptRepository,executedScriptInfoSource,useScriptFileLastModificationDates,allowOutOfSequenceExecutionOfPatchScripts).calculateScriptUpdates();
  if (!getIndexedScriptsThatFailedDuringLastUpdate().isEmpty()) {
    if (!scriptUpdates.hasIrregularScriptUpdates()) {
      throw new DbMaintainException("String_Node_Str" + getIndexedScriptsThatFailedDuringLastUpdate().first() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    }
  }
  if (!getRepeatableScriptsThatFailedDuringLastUpdate().isEmpty() && !scriptUpdates.hasIrregularScriptUpdates()) {
    for (    ExecutedScript failedScript : getRepeatableScriptsThatFailedDuringLastUpdate()) {
      if (!scriptUpdates.getRegularScriptUpdates(REPEATABLE_SCRIPT_UPDATED).contains(new ScriptUpdate(REPEATABLE_SCRIPT_UPDATED,failedScript.getScript())) && !scriptUpdates.getRepeatableScriptDeletions().contains(new ScriptUpdate(REPEATABLE_SCRIPT_DELETED,failedScript.getScript()))) {
        throw new DbMaintainException("String_Node_Str" + getRepeatableScriptsThatFailedDuringLastUpdate().first() + "String_Node_Str"+ "String_Node_Str");
      }
    }
  }
  if (scriptUpdates.isEmpty()) {
    logger.info("String_Node_Str");
    return;
  }
  boolean recreateFromScratch=false;
  if (fromScratchEnabled && !hasItemsToPreserve && isInitialDatabaseUpdate()) {
    logger.info("String_Node_Str");
    recreateFromScratch=true;
  }
  if (scriptUpdates.hasIrregularScriptUpdates()) {
    if (fromScratchEnabled) {
      logger.info("String_Node_Str" + formatIrregularUpdates(scriptUpdates));
      recreateFromScratch=true;
    }
 else {
      throw new DbMaintainException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str" + formatIrregularUpdates(scriptUpdates) + "String_Node_Str");
    }
  }
  if (recreateFromScratch) {
    clearDatabase();
    executeScripts(scriptRepository.getAllUpdateScripts());
  }
 else {
    logger.info("String_Node_Str" + formatRegularUpdates(scriptUpdates));
    if (cleanDbEnabled) {
      dbCleaner.cleanDatabase();
    }
    executeScriptUpdates(scriptUpdates.getRegularPatchScriptUpdates());
    executeScriptUpdates(scriptUpdates.getRegularScriptUpdates());
  }
  executeScripts(scriptRepository.getPostProcessingScripts());
  if (disableConstraintsEnabled) {
    constraintsDisabler.disableConstraints();
  }
  if (updateSequencesEnabled) {
    sequenceUpdater.updateSequences();
  }
}