Program: 87365
Project: 87365
Buggy source:
/** 
 * Merge an amendment container DTO from the backend into the current list of amendment controllers.
 * @param toMerge the amendment container DTOs to merge
 */
protected void mergeAmendmentContainerDTOs(AmendmentContainerDTO... toMerge){
  if (toMerge != null) {
    final ClientFactory clientFactory=documentController.getClientFactory();
    for (    final AmendmentContainerDTO amendmentContainerDTO : toMerge) {
      final AmendmentController amendmentController=documentController.getInjector().getAmendmentController();
      amendmentController.setModel(amendmentContainerDTO);
      amendmentController.setDocumentController(documentController);
      int indexOfOlderRevision=-1;
      int counter=0;
      for (      final AmendmentController ac : amendmentControllers) {
        if (amendmentController.getModel().getId().equals(ac.getModel().getId())) {
          indexOfOlderRevision=counter;
          break;
        }
        counter++;
      }
      if (indexOfOlderRevision != -1) {
        final AmendmentController removed=amendmentControllers.remove(indexOfOlderRevision);
        amendmentControllers.add(indexOfOlderRevision,amendmentController);
        if (!removed.getDocumentController().equals(amendmentController.getDocumentController())) {
          throw new RuntimeException("String_Node_Str");
        }
        LOG.info("String_Node_Str" + removed + "String_Node_Str"+ amendmentController);
        documentEventBus.fireEvent(new AmendmentContainerUpdatedEvent(removed,amendmentController));
      }
 else {
        amendmentControllers.add(amendmentController);
        LOG.info("String_Node_Str" + amendmentController);
        documentEventBus.fireEvent(new AmendmentContainerInjectEvent(toMerge));
      }
      documentEventBus.fireEvent(new AmendmentContainerSavedEvent(amendmentController));
    }
    documentEventBus.fireEvent(new NotificationEvent(clientFactory.getCoreMessages().amendmentActionSaveSuccessful(toMerge.length)));
  }
}

Fixed version (ground truth):
/** 
 * Merge an amendment container DTO from the backend into the current list of amendment controllers.
 * @param toMerge the amendment container DTOs to merge
 */
protected void mergeAmendmentContainerDTOs(AmendmentContainerDTO... toMerge){
  if (toMerge != null) {
    final ClientFactory clientFactory=documentController.getClientFactory();
    for (    final AmendmentContainerDTO amendmentContainerDTO : toMerge) {
      final AmendmentController amendmentController=createAmendmentController(amendmentContainerDTO);
      int indexOfOlderRevision=-1;
      int counter=0;
      for (      final AmendmentController ac : amendmentControllers) {
        if (amendmentController.getModel().getId().equals(ac.getModel().getId())) {
          indexOfOlderRevision=counter;
          break;
        }
        counter++;
      }
      if (indexOfOlderRevision != -1) {
        final AmendmentController removed=amendmentControllers.remove(indexOfOlderRevision);
        amendmentControllers.add(indexOfOlderRevision,amendmentController);
        if (!removed.getDocumentController().equals(amendmentController.getDocumentController())) {
          throw new RuntimeException("String_Node_Str");
        }
        LOG.info("String_Node_Str" + removed + "String_Node_Str"+ amendmentController);
        documentEventBus.fireEvent(new AmendmentContainerUpdatedEvent(removed,amendmentController));
      }
 else {
        amendmentControllers.add(amendmentController);
        LOG.info("String_Node_Str" + amendmentController);
        documentEventBus.fireEvent(new AmendmentContainerInjectEvent(toMerge));
      }
      documentEventBus.fireEvent(new AmendmentContainerSavedEvent(amendmentController));
    }
    documentEventBus.fireEvent(new NotificationEvent(clientFactory.getCoreMessages().amendmentActionSaveSuccessful(toMerge.length)));
  }
}