Program: 62245
Project: 62245
Buggy source:
@Override public void process(AddNodeOperation operation){
  Topology topology=EditionContextManager.getTopology();
  if (!TopologyUtils.isValidNodeName(operation.getNodeName())) {
    throw new InvalidNodeNameException("String_Node_Str");
  }
  topologyService.isUniqueNodeTemplateName(topology,operation.getNodeName());
  String[] splittedId=operation.getIndexedNodeTypeId().split("String_Node_Str");
  NodeType indexedNodeType=searchService.find(NodeType.class,splittedId[0],splittedId[1]);
  if (indexedNodeType == null) {
    throw new NotFoundException(NodeType.class.getName(),operation.getIndexedNodeTypeId(),"String_Node_Str");
  }
  if (indexedNodeType.getSubstitutionTopologyId() != null) {
    if (indexedNodeType.getSubstitutionTopologyId().equals(topology.getId())) {
      throw new CyclicReferenceException("String_Node_Str");
    }
    topologyCompositionService.recursivelyDetectTopologyCompositionCyclicReference(topology.getId(),indexedNodeType.getSubstitutionTopologyId());
  }
  if (topology.getNodeTemplates() == null) {
    topology.setNodeTemplates(new HashMap<>());
  }
  log.debug("String_Node_Str",operation.getNodeName());
  Set<CSARDependency> oldDependencies=topology.getDependencies();
  indexedNodeType=topologyService.loadType(topology,indexedNodeType);
  NodeTemplate nodeTemplate=topologyService.buildNodeTemplate(topology.getDependencies(),indexedNodeType,null);
  nodeTemplate.setName(operation.getNodeName());
  topology.getNodeTemplates().put(operation.getNodeName(),nodeTemplate);
  log.debug("String_Node_Str" + operation.getNodeName() + "String_Node_Str"+ operation.getIndexedNodeTypeId()+ "String_Node_Str"+ topology.getId()+ "String_Node_Str");
  WorkflowsBuilderService.TopologyContext topologyContext=workflowBuilderService.buildTopologyContext(topology);
  workflowBuilderService.addNode(topologyContext,operation.getNodeName(),nodeTemplate);
  if (!Objects.equals(topology.getDependencies(),oldDependencies)) {
    csarService.setDependencies(topology.getId(),topology.getDependencies());
  }
}

Fixed version (ground truth):
@Override public void process(AddNodeOperation operation){
  Topology topology=EditionContextManager.getTopology();
  if (!TopologyUtils.isValidNodeName(operation.getNodeName())) {
    throw new InvalidNodeNameException("String_Node_Str");
  }
  topologyService.isUniqueNodeTemplateName(topology,operation.getNodeName());
  String[] splittedId=operation.getIndexedNodeTypeId().split("String_Node_Str");
  NodeType indexedNodeType=searchService.find(NodeType.class,splittedId[0],splittedId[1]);
  if (indexedNodeType == null) {
    throw new NotFoundException(NodeType.class.getName(),operation.getIndexedNodeTypeId(),"String_Node_Str");
  }
  if (indexedNodeType.getSubstitutionTopologyId() != null) {
    if (indexedNodeType.getSubstitutionTopologyId().equals(topology.getId())) {
      throw new CyclicReferenceException("String_Node_Str");
    }
    topologyCompositionService.recursivelyDetectTopologyCompositionCyclicReference(topology.getId(),indexedNodeType.getSubstitutionTopologyId());
  }
  if (topology.getNodeTemplates() == null) {
    topology.setNodeTemplates(new HashMap<>());
  }
  log.debug("String_Node_Str",operation.getNodeName());
  indexedNodeType=topologyService.loadType(topology,indexedNodeType);
  NodeTemplate nodeTemplate=topologyService.buildNodeTemplate(topology.getDependencies(),indexedNodeType,null);
  nodeTemplate.setName(operation.getNodeName());
  topology.getNodeTemplates().put(operation.getNodeName(),nodeTemplate);
  log.debug("String_Node_Str" + operation.getNodeName() + "String_Node_Str"+ operation.getIndexedNodeTypeId()+ "String_Node_Str"+ topology.getId()+ "String_Node_Str");
  WorkflowsBuilderService.TopologyContext topologyContext=workflowBuilderService.buildTopologyContext(topology);
  workflowBuilderService.addNode(topologyContext,operation.getNodeName(),nodeTemplate);
}