Program: 88431
Project: 88431
Buggy source:
@Override public void run(ProgressStatus progressStatus){
  validationSuite.getValidationRules().forEach(validationRule -> validationRule.getViolations().clear());
  LocalSyncTransactionCommitListener localSyncTransactionCommitListener=LocalSyncProjectEventListenerAdapter.getProjectMapping(project).getLocalSyncTransactionCommitListener();
  if ((elementsToUpdate == null || elementsToUpdate.isEmpty()) && (elementsToDelete == null || elementsToDelete.isEmpty())) {
    Application.getInstance().getGUILog().log("String_Node_Str");
    return;
  }
  if (elementsToUpdate != null && !elementsToUpdate.isEmpty()) {
    boolean initialAutoNumbering=Application.getInstance().getProject().getOptions().isAutoNumbering();
    try {
      Application.getInstance().getGUILog().log("String_Node_Str" + NumberFormat.getInstance().format(elementsToUpdate.size()) + "String_Node_Str"+ (elementsToUpdate.size() != 1 ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
      if (localSyncTransactionCommitListener != null) {
        localSyncTransactionCommitListener.setDisabled(true);
      }
      Application.getInstance().getProject().getOptions().isAutoNumbering();
      EMFBulkImporter emfBulkImporter=new EMFBulkImporter(NAME){
        @Override public void onSuccess(){
          if (elementsToDelete != null && !elementsToDelete.isEmpty()) {
            Application.getInstance().getGUILog().log("String_Node_Str" + NumberFormat.getInstance().format(elementsToDelete.size()) + "String_Node_Str"+ (elementsToDelete.size() != 1 ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
            if (localSyncTransactionCommitListener != null) {
              localSyncTransactionCommitListener.setDisabled(true);
            }
            if (!SessionManager.getInstance().isSessionCreated()) {
              SessionManager.getInstance().createSession(UpdateClientElementAction.class.getName() + "String_Node_Str");
            }
            for (            String id : elementsToDelete) {
              Exception exception=null;
              Element element=Converters.getIdToElementConverter().apply(id,project);
              if (element == null) {
                continue;
              }
              try {
                ModelElementsManager.getInstance().removeElement(element);
              }
 catch (              ReadOnlyElementException|RuntimeException e) {
                exception=e;
              }
              if (exception == null) {
                successfulChangeValidationRule.addViolation(project.getPrimaryModel(),"String_Node_Str" + Changelog.ChangeType.DELETED.name() + "String_Node_Str"+ element.getHumanName());
              }
 else {
                (exception instanceof ReadOnlyElementException ? editableValidationRule : failedChangeValidationRule).addViolation(element,"String_Node_Str" + exception.getMessage());
                failedChangelog.addChange(id,null,Changelog.ChangeType.DELETED);
              }
            }
            if (localSyncTransactionCommitListener != null) {
              localSyncTransactionCommitListener.setDisabled(false);
            }
            if (SessionManager.getInstance().isSessionCreated()) {
              SessionManager.getInstance().closeSession();
            }
          }
        }
        @Override public void onFailure(){
          onSuccess();
        }
      }
;
      Changelog<String,Pair<Element,ObjectNode>> changelog=emfBulkImporter.apply(elementsToUpdate,project,progressStatus);
      for (      Map.Entry<Pair<Element,ObjectNode>,Exception> entry : emfBulkImporter.getFailedElementMap().entrySet()) {
        Element element=entry.getKey().getKey();
        ObjectNode objectNode=entry.getKey().getValue();
        Exception exception=entry.getValue();
        JsonNode sysmlIdJsonNode=objectNode.get(MDKConstants.ID_KEY);
        if (sysmlIdJsonNode == null || !sysmlIdJsonNode.isTextual()) {
          continue;
        }
        String sysmlId=sysmlIdJsonNode.asText();
        String name=null;
        if (element == null || Project.isElementDisposed(element)) {
          JsonNode nameJsonNode=objectNode.get(MDKConstants.NAME_KEY);
          if (nameJsonNode != null && nameJsonNode.isTextual()) {
            name=nameJsonNode.asText("String_Node_Str");
          }
          if (name == null || name.isEmpty()) {
            name="String_Node_Str";
          }
        }
        ValidationRuleViolation validationRuleViolation=new ValidationRuleViolation(element != null && !Project.isElementDisposed(element) ? element : project.getPrimaryModel(),"String_Node_Str" + (element != null && !Project.isElementDisposed(element) ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ (element == null || Project.isElementDisposed(element) ? "String_Node_Str" + objectNode.get(MDKConstants.TYPE_KEY).asText("String_Node_Str") + "String_Node_Str"+ name+ "String_Node_Str"+ sysmlId : "String_Node_Str")+ ((element == null || Project.isElementDisposed(element)) && exception != null ? "String_Node_Str" : "String_Node_Str")+ (exception != null ? "String_Node_Str" + (exception instanceof ReadOnlyElementException ? "String_Node_Str" : exception.getMessage()) : "String_Node_Str"));
        ActionsCategory copyActionsCategory=new ActionsCategory("String_Node_Str","String_Node_Str");
        copyActionsCategory.setNested(true);
        validationRuleViolation.addAction(copyActionsCategory);
        copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",sysmlId));
        JsonNode diff=null;
        if (element != null) {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str","String_Node_Str" + element.getID()));
          ObjectNode elementObjectNode=Converters.getElementToJsonConverter().apply(element,project);
          if (elementObjectNode != null) {
            try {
              copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(elementObjectNode)));
            }
 catch (            JsonProcessingException ignored) {
            }
            diff=JsonPatchFunction.getInstance().apply(elementObjectNode,objectNode);
          }
        }
        try {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(objectNode)));
        }
 catch (        JsonProcessingException ignored) {
        }
        if (diff != null) {
          try {
            copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(diff)));
          }
 catch (          JsonProcessingException ignored) {
          }
        }
        (exception instanceof ReadOnlyElementException ? editableValidationRule : failedChangeValidationRule).addViolation(validationRuleViolation);
        failedChangelog.addChange(sysmlId,objectNode,element != null && !Project.isElementDisposed(element) ? Changelog.ChangeType.UPDATED : Changelog.ChangeType.CREATED);
      }
      for (      Map.Entry<Element,ObjectNode> entry : emfBulkImporter.getNonEquivalentElements().entrySet()) {
        Element element=entry.getKey();
        String sysmlId=element.getLocalID();
        ObjectNode clientElementObjectNode=Converters.getElementToJsonConverter().apply(element,project);
        ObjectNode serverElementObjectNode=entry.getValue();
        JsonNode diff=JsonPatchFunction.getInstance().apply(clientElementObjectNode,serverElementObjectNode);
        ValidationRuleViolation validationRuleViolation=new ValidationRuleViolation(entry.getKey(),"String_Node_Str");
        ActionsCategory copyActionsCategory=new ActionsCategory("String_Node_Str","String_Node_Str");
        copyActionsCategory.setNested(true);
        validationRuleViolation.addAction(copyActionsCategory);
        copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",sysmlId));
        copyActionsCategory.addAction(new ClipboardAction("String_Node_Str","String_Node_Str" + element.getID()));
        try {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(clientElementObjectNode)));
        }
 catch (        JsonProcessingException ignored) {
        }
        try {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(serverElementObjectNode)));
        }
 catch (        JsonProcessingException ignored) {
        }
        try {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(diff)));
        }
 catch (        JsonProcessingException ignored) {
        }
        equivalentElementValidationRule.addViolation(validationRuleViolation);
      }
      for (      Changelog.ChangeType changeType : Changelog.ChangeType.values()) {
        for (        Map.Entry<String,Pair<Element,ObjectNode>> entry : changelog.get(changeType).entrySet()) {
          successfulChangeValidationRule.addViolation(new ValidationRuleViolation(entry.getValue().getKey(),"String_Node_Str" + SyncElement.Type.MMS.name() + "String_Node_Str"+ changeType.name()+ "String_Node_Str"+ SyncElement.Type.LOCAL.name()+ "String_Node_Str"));
        }
      }
    }
  finally {
      Application.getInstance().getProject().getOptions().setAutoNumbering(initialAutoNumbering);
      if (localSyncTransactionCommitListener != null) {
        localSyncTransactionCommitListener.setDisabled(false);
      }
    }
  }
  if (validationSuite.hasErrors()) {
    Utils.displayValidationWindow(project,validationSuite,validationSuite.getName());
  }
}

Fixed version (ground truth):
@Override public void run(ProgressStatus progressStatus){
  validationSuite.getValidationRules().forEach(validationRule -> validationRule.getViolations().clear());
  LocalSyncTransactionCommitListener localSyncTransactionCommitListener=LocalSyncProjectEventListenerAdapter.getProjectMapping(project).getLocalSyncTransactionCommitListener();
  if ((elementsToUpdate == null || elementsToUpdate.isEmpty()) && (elementsToDelete == null || elementsToDelete.isEmpty())) {
    Application.getInstance().getGUILog().log("String_Node_Str");
    return;
  }
  if (elementsToUpdate != null && !elementsToUpdate.isEmpty()) {
    boolean initialAutoNumbering=Application.getInstance().getProject().getOptions().isAutoNumbering();
    try {
      Application.getInstance().getGUILog().log("String_Node_Str" + NumberFormat.getInstance().format(elementsToUpdate.size()) + "String_Node_Str"+ (elementsToUpdate.size() != 1 ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
      if (localSyncTransactionCommitListener != null) {
        localSyncTransactionCommitListener.setDisabled(true);
      }
      Application.getInstance().getProject().getOptions().isAutoNumbering();
      EMFBulkImporter emfBulkImporter=new EMFBulkImporter(NAME){
        @Override public void onSuccess(){
          if (elementsToDelete != null && !elementsToDelete.isEmpty()) {
            Application.getInstance().getGUILog().log("String_Node_Str" + NumberFormat.getInstance().format(elementsToDelete.size()) + "String_Node_Str"+ (elementsToDelete.size() != 1 ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
            if (localSyncTransactionCommitListener != null) {
              localSyncTransactionCommitListener.setDisabled(true);
            }
            if (!SessionManager.getInstance().isSessionCreated()) {
              SessionManager.getInstance().createSession(UpdateClientElementAction.class.getName() + "String_Node_Str");
            }
            for (            String id : elementsToDelete) {
              Exception exception=null;
              Element element=Converters.getIdToElementConverter().apply(id,project);
              if (element == null) {
                continue;
              }
              try {
                ModelElementsManager.getInstance().removeElement(element);
              }
 catch (              ReadOnlyElementException|RuntimeException e) {
                exception=e;
              }
              if (exception == null) {
                successfulChangeValidationRule.addViolation(project.getPrimaryModel(),"String_Node_Str" + Changelog.ChangeType.DELETED.name() + "String_Node_Str"+ element.getHumanName());
              }
 else {
                (exception instanceof ReadOnlyElementException ? editableValidationRule : failedChangeValidationRule).addViolation(element,"String_Node_Str" + exception.getMessage());
                failedChangelog.addChange(id,null,Changelog.ChangeType.DELETED);
              }
            }
            if (localSyncTransactionCommitListener != null) {
              localSyncTransactionCommitListener.setDisabled(false);
            }
            if (SessionManager.getInstance().isSessionCreated()) {
              SessionManager.getInstance().closeSession();
            }
          }
        }
        @Override public void onFailure(){
          onSuccess();
        }
      }
;
      Changelog<String,Pair<Element,ObjectNode>> changelog=emfBulkImporter.apply(elementsToUpdate,project,progressStatus);
      for (      Map.Entry<Pair<Element,ObjectNode>,Exception> entry : emfBulkImporter.getFailedElementMap().entrySet()) {
        Element element=entry.getKey().getKey();
        ObjectNode objectNode=entry.getKey().getValue();
        Exception exception=entry.getValue();
        JsonNode sysmlIdJsonNode=objectNode.get(MDKConstants.ID_KEY);
        if (sysmlIdJsonNode == null || !sysmlIdJsonNode.isTextual()) {
          continue;
        }
        String sysmlId=sysmlIdJsonNode.asText();
        String name=null;
        if (element == null || Project.isElementDisposed(element)) {
          JsonNode nameJsonNode=objectNode.get(MDKConstants.NAME_KEY);
          if (nameJsonNode != null && nameJsonNode.isTextual()) {
            name=nameJsonNode.asText("String_Node_Str");
          }
          if (name == null || name.isEmpty()) {
            name="String_Node_Str";
          }
        }
        ValidationRuleViolation validationRuleViolation=new ValidationRuleViolation(element != null && !Project.isElementDisposed(element) ? element : project.getPrimaryModel(),"String_Node_Str" + (element != null && !Project.isElementDisposed(element) ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ (element == null || Project.isElementDisposed(element) ? "String_Node_Str" + objectNode.get(MDKConstants.TYPE_KEY).asText("String_Node_Str") + "String_Node_Str"+ name+ "String_Node_Str"+ sysmlId : "String_Node_Str")+ ((element == null || Project.isElementDisposed(element)) && exception != null ? "String_Node_Str" : "String_Node_Str")+ (exception != null ? "String_Node_Str" + (exception instanceof ReadOnlyElementException ? "String_Node_Str" : exception.getMessage()) : "String_Node_Str"));
        ActionsCategory copyActionsCategory=new ActionsCategory("String_Node_Str","String_Node_Str");
        copyActionsCategory.setNested(true);
        validationRuleViolation.addAction(copyActionsCategory);
        copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",sysmlId));
        JsonNode diff=null;
        if (element != null) {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str","String_Node_Str" + element.getLocalID()));
          ObjectNode elementObjectNode=Converters.getElementToJsonConverter().apply(element,project);
          if (elementObjectNode != null) {
            try {
              copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(elementObjectNode)));
            }
 catch (            JsonProcessingException ignored) {
            }
            diff=JsonPatchFunction.getInstance().apply(elementObjectNode,objectNode);
          }
        }
        try {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(objectNode)));
        }
 catch (        JsonProcessingException ignored) {
        }
        if (diff != null) {
          try {
            copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(diff)));
          }
 catch (          JsonProcessingException ignored) {
          }
        }
        (exception instanceof ReadOnlyElementException ? editableValidationRule : failedChangeValidationRule).addViolation(validationRuleViolation);
        failedChangelog.addChange(sysmlId,objectNode,element != null && !Project.isElementDisposed(element) ? Changelog.ChangeType.UPDATED : Changelog.ChangeType.CREATED);
      }
      for (      Map.Entry<Element,ObjectNode> entry : emfBulkImporter.getNonEquivalentElements().entrySet()) {
        Element element=entry.getKey();
        String sysmlId=element.getLocalID();
        ObjectNode clientElementObjectNode=Converters.getElementToJsonConverter().apply(element,project);
        ObjectNode serverElementObjectNode=entry.getValue();
        JsonNode diff=JsonPatchFunction.getInstance().apply(clientElementObjectNode,serverElementObjectNode);
        ValidationRuleViolation validationRuleViolation=new ValidationRuleViolation(entry.getKey(),"String_Node_Str");
        ActionsCategory copyActionsCategory=new ActionsCategory("String_Node_Str","String_Node_Str");
        copyActionsCategory.setNested(true);
        validationRuleViolation.addAction(copyActionsCategory);
        copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",sysmlId));
        copyActionsCategory.addAction(new ClipboardAction("String_Node_Str","String_Node_Str" + element.getLocalID()));
        try {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(clientElementObjectNode)));
        }
 catch (        JsonProcessingException ignored) {
        }
        try {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(serverElementObjectNode)));
        }
 catch (        JsonProcessingException ignored) {
        }
        try {
          copyActionsCategory.addAction(new ClipboardAction("String_Node_Str",JacksonUtils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(diff)));
        }
 catch (        JsonProcessingException ignored) {
        }
        equivalentElementValidationRule.addViolation(validationRuleViolation);
      }
      for (      Changelog.ChangeType changeType : Changelog.ChangeType.values()) {
        for (        Map.Entry<String,Pair<Element,ObjectNode>> entry : changelog.get(changeType).entrySet()) {
          Element successElement=entry.getValue().getKey();
          successfulChangeValidationRule.addViolation(new ValidationRuleViolation(successElement,"String_Node_Str" + SyncElement.Type.MMS.name() + "String_Node_Str"+ changeType.name()+ "String_Node_Str"+ SyncElement.Type.LOCAL.name()+ "String_Node_Str"));
          successfulChangelog.addChange(successElement.getLocalID(),null,changeType);
        }
      }
    }
  finally {
      Application.getInstance().getProject().getOptions().setAutoNumbering(initialAutoNumbering);
      if (localSyncTransactionCommitListener != null) {
        localSyncTransactionCommitListener.setDisabled(false);
      }
    }
  }
  if (validationSuite.hasErrors()) {
    Utils.displayValidationWindow(project,validationSuite,validationSuite.getName());
  }
}