Program: 143868
Project: 143868
Buggy source:
public ScriptUpdates calculateScriptUpdates(){
  regularScriptUpdates=initScriptUpdateMap(ScriptUpdateType.getRegularScriptUpdateTypes());
  irregularScriptUpdates=initScriptUpdateMap(ScriptUpdateType.getIrregularScriptUpdateTypes());
  patchScriptUpdates=initScriptUpdateMap(ScriptUpdateType.getPatchScriptUpdateTypes());
  postprocessingScriptUpdates=initScriptUpdateMap(ScriptUpdateType.getPostprocessingScriptUpdateTypes());
  Map<Script,ExecutedScript> alreadyExecutedScripts=getAlreadyExecutedScripts(executedScriptInfoSource);
  SortedSet<Script> allScripts=scriptRepository.getAllScripts();
  for (  Script alreadyExecutedScript : alreadyExecutedScripts.keySet()) {
    if (!allScripts.contains(alreadyExecutedScript)) {
      if (alreadyExecutedScript.isIncremental()) {
        addIrregularScriptUpdate(INDEXED_SCRIPT_DELETED,alreadyExecutedScript);
      }
 else       if (alreadyExecutedScript.isRepeatable()) {
        logger.warn("String_Node_Str");
      }
 else       if (alreadyExecutedScript.isPostProcessingScript()) {
        addPostprocessingScriptUpdate(POSTPROCESSING_SCRIPT_DELETED,alreadyExecutedScript);
      }
    }
  }
  Script scriptWithHighestScriptIndex=getExecutedScriptWithHighestScriptIndex(executedScriptInfoSource.getExecutedScripts());
  for (  Script indexedScript : scriptRepository.getIndexedScripts()) {
    if (!alreadyExecutedScripts.containsKey(indexedScript)) {
      if (scriptWithHighestScriptIndex == null || indexedScript.compareTo(scriptWithHighestScriptIndex) > 0) {
        addRegularScriptUpdate(HIGHER_INDEX_SCRIPT_ADDED,indexedScript);
      }
 else {
        if (indexedScript.isPatchScript()) {
          if (allowOutOfSequenceExecutionOfPatchScripts) {
            addPatchScriptUpdate(LOWER_INDEX_PATCH_SCRIPT_ADDED,indexedScript);
          }
 else {
            addIrregularScriptUpdate(LOWER_INDEX_PATCH_SCRIPT_ADDED,indexedScript);
          }
        }
 else {
          addIrregularScriptUpdate(LOWER_INDEX_NON_PATCH_SCRIPT_ADDED,indexedScript);
        }
      }
    }
 else {
      if (!alreadyExecutedScripts.get(indexedScript).getScript().isScriptContentEqualTo(indexedScript,useScriptFileLastModificationDates)) {
        addIrregularScriptUpdate(INDEXED_SCRIPT_UPDATED,indexedScript);
      }
    }
  }
  for (  Script repeatableScript : scriptRepository.getRepeatableScripts()) {
    if (!alreadyExecutedScripts.containsKey(repeatableScript)) {
      addRegularScriptUpdate(REPEATABLE_SCRIPT_ADDED,repeatableScript);
    }
 else {
      if (!alreadyExecutedScripts.get(repeatableScript).getScript().isScriptContentEqualTo(repeatableScript,useScriptFileLastModificationDates)) {
        addRegularScriptUpdate(REPEATABLE_SCRIPT_UPDATED,repeatableScript);
      }
    }
  }
  for (  Script postprocessingScript : scriptRepository.getPostProcessingScripts()) {
    if (!alreadyExecutedScripts.containsKey(postprocessingScript)) {
      addPostprocessingScriptUpdate(POSTPROCESSING_SCRIPT_ADDED,postprocessingScript);
    }
 else {
      if (!alreadyExecutedScripts.get(postprocessingScript).getScript().isScriptContentEqualTo(postprocessingScript,useScriptFileLastModificationDates)) {
        addPostprocessingScriptUpdate(POSTPROCESSING_SCRIPT_UPDATED,postprocessingScript);
      }
    }
  }
  return new ScriptUpdates(regularScriptUpdates,irregularScriptUpdates,patchScriptUpdates,postprocessingScriptUpdates);
}

Fixed version (ground truth):
public ScriptUpdates calculateScriptUpdates(){
  regularScriptUpdates=initScriptUpdateMap(ScriptUpdateType.getRegularScriptUpdateTypes());
  irregularScriptUpdates=initScriptUpdateMap(ScriptUpdateType.getIrregularScriptUpdateTypes());
  repeatableScriptDeletions=initScriptUpdateMap(ScriptUpdateType.getRepeatableScriptDeletionTypes());
  patchScriptUpdates=initScriptUpdateMap(ScriptUpdateType.getPatchScriptUpdateTypes());
  postprocessingScriptUpdates=initScriptUpdateMap(ScriptUpdateType.getPostprocessingScriptUpdateTypes());
  Map<Script,ExecutedScript> alreadyExecutedScripts=getAlreadyExecutedScripts(executedScriptInfoSource);
  SortedSet<Script> allScripts=scriptRepository.getAllScripts();
  for (  Script alreadyExecutedScript : alreadyExecutedScripts.keySet()) {
    if (!allScripts.contains(alreadyExecutedScript)) {
      if (alreadyExecutedScript.isIncremental()) {
        addIrregularScriptUpdate(INDEXED_SCRIPT_DELETED,alreadyExecutedScript);
      }
 else       if (alreadyExecutedScript.isRepeatable()) {
        addRepeatableScriptDeletion(alreadyExecutedScript);
      }
 else       if (alreadyExecutedScript.isPostProcessingScript()) {
        addPostprocessingScriptUpdate(POSTPROCESSING_SCRIPT_DELETED,alreadyExecutedScript);
      }
    }
  }
  Script scriptWithHighestScriptIndex=getExecutedScriptWithHighestScriptIndex(executedScriptInfoSource.getExecutedScripts());
  for (  Script indexedScript : scriptRepository.getIndexedScripts()) {
    if (!alreadyExecutedScripts.containsKey(indexedScript)) {
      if (scriptWithHighestScriptIndex == null || indexedScript.compareTo(scriptWithHighestScriptIndex) > 0) {
        addRegularScriptUpdate(HIGHER_INDEX_SCRIPT_ADDED,indexedScript);
      }
 else {
        if (indexedScript.isPatchScript()) {
          if (allowOutOfSequenceExecutionOfPatchScripts) {
            addPatchScriptUpdate(LOWER_INDEX_PATCH_SCRIPT_ADDED,indexedScript);
          }
 else {
            addIrregularScriptUpdate(LOWER_INDEX_PATCH_SCRIPT_ADDED,indexedScript);
          }
        }
 else {
          addIrregularScriptUpdate(LOWER_INDEX_NON_PATCH_SCRIPT_ADDED,indexedScript);
        }
      }
    }
 else {
      if (!alreadyExecutedScripts.get(indexedScript).getScript().isScriptContentEqualTo(indexedScript,useScriptFileLastModificationDates)) {
        addIrregularScriptUpdate(INDEXED_SCRIPT_UPDATED,indexedScript);
      }
    }
  }
  for (  Script repeatableScript : scriptRepository.getRepeatableScripts()) {
    if (!alreadyExecutedScripts.containsKey(repeatableScript)) {
      addRegularScriptUpdate(REPEATABLE_SCRIPT_ADDED,repeatableScript);
    }
 else {
      if (!alreadyExecutedScripts.get(repeatableScript).getScript().isScriptContentEqualTo(repeatableScript,useScriptFileLastModificationDates)) {
        addRegularScriptUpdate(REPEATABLE_SCRIPT_UPDATED,repeatableScript);
      }
    }
  }
  for (  Script postprocessingScript : scriptRepository.getPostProcessingScripts()) {
    if (!alreadyExecutedScripts.containsKey(postprocessingScript)) {
      addPostprocessingScriptUpdate(POSTPROCESSING_SCRIPT_ADDED,postprocessingScript);
    }
 else {
      if (!alreadyExecutedScripts.get(postprocessingScript).getScript().isScriptContentEqualTo(postprocessingScript,useScriptFileLastModificationDates)) {
        addPostprocessingScriptUpdate(POSTPROCESSING_SCRIPT_UPDATED,postprocessingScript);
      }
    }
  }
  return new ScriptUpdates(regularScriptUpdates,irregularScriptUpdates,repeatableScriptDeletions,patchScriptUpdates,postprocessingScriptUpdates);
}