Program: 121604
Project: 121604
Buggy source:
public Node cloneNode(Node node,IProcess process,Map<String,List<? extends IElementParameter>> paraMap,boolean lockByOther){
  NodePart nodePart=new NodePart();
  IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
  boolean isInOut=false;
  if (service != null) {
    isInOut=service.isJobletInOutComponent(node);
  }
  Node cloneNode=null;
  if (isInOut) {
    cloneNode=new Node(node.getComponent(),(IProcess2)process,node.getUniqueName());
  }
 else {
    cloneNode=new Node(node.getComponent(),(IProcess2)process);
  }
  nodePart.setModel(cloneNode);
  cloneNode.setLabel(node.getLabel());
  if (lockByOther) {
    cloneNode.setReadOnly(true);
  }
 else {
    cloneNode.setReadOnly(false);
  }
  cloneNode.setDummy(node.isDummy());
  cloneNode.setActivate(node.isActivate());
  List<? extends IElementParameter> elementParas=null;
  if (paraMap.containsKey(node.getUniqueName())) {
    elementParas=(List<? extends IElementParameter>)paraMap.get(node.getUniqueName());
  }
 else {
    elementParas=node.getElementParameters();
  }
  for (  IElementParameter elementPara : elementParas) {
    if (elementPara.getName() != null && !elementPara.getName().equals("String_Node_Str")) {
      IElementParameter cloneElement=cloneNode.getElementParameter(elementPara.getName());
      Object paValue=elementPara.getValue();
      if (paValue instanceof List) {
        List list=new ArrayList();
        list.addAll((List)paValue);
        cloneElement.setValue(list);
      }
 else {
        cloneElement.setValue(elementPara.getValue());
      }
      if (lockByOther) {
        cloneElement.setReadOnly(true);
      }
 else {
        cloneElement.setReadOnly(elementPara.isReadOnly());
      }
      if (elementPara.getChildParameters() != null) {
        Map<String,IElementParameter> elementParaChild=elementPara.getChildParameters();
        Map<String,IElementParameter> cloneElementChild=cloneElement.getChildParameters();
        Iterator<Entry<String,IElementParameter>> ite=elementParaChild.entrySet().iterator();
        while (ite.hasNext()) {
          Entry<String,IElementParameter> entry=ite.next();
          String key=entry.getKey();
          IElementParameter c=entry.getValue();
          if (key != null && c != null) {
            IElementParameter cloneC=cloneElementChild.get(key);
            if (cloneC != null) {
              cloneC.setValue(c.getValue());
              if (lockByOther) {
                cloneC.setReadOnly(true);
              }
 else {
                cloneC.setReadOnly(c.isReadOnly());
              }
            }
          }
        }
      }
    }
  }
  for (  IElementParameter param : cloneNode.getElementParameters()) {
    String repositoryValue=param.getRepositoryValue();
    if (param.isShow(cloneNode.getElementParameters()) && (repositoryValue != null) && (!param.getName().equals(EParameterName.PROPERTY_TYPE.getName()))&& param.getFieldType() != EParameterFieldType.MEMO_SQL) {
      param.setRepositoryValueUsed(true);
      param.setReadOnly(true);
    }
  }
  cloneNode.setMetadataList(node.getMetadataList());
  cloneNode.setListConnector(node.getListConnector());
  cloneNode.setConnectionName(node.getConnectionName());
  cloneNode.setLocation(node.getLocation());
  IExternalNode externalNode=cloneNode.getExternalNode();
  if (externalNode != null) {
    if (node.getExternalData() != null) {
      try {
        externalNode.setExternalData(node.getExternalData().clone());
      }
 catch (      CloneNotSupportedException e) {
        ExceptionHandler.process(e);
      }
      ((Node)cloneNode).setExternalData(externalNode.getExternalData());
    }
    if (node.getExternalNode().getExternalEmfData() != null) {
      externalNode.setExternalEmfData(EcoreUtil.copy(node.getExternalNode().getExternalEmfData()));
    }
    if (node.getExternalNode() != null) {
      ImageDescriptor screenshot=node.getExternalNode().getScreenshot();
      if (screenshot != null) {
        externalNode.setScreenshot(screenshot);
      }
    }
  }
  return cloneNode;
}

Fixed version (ground truth):
public Node cloneNode(Node node,IProcess process,Map<String,List<? extends IElementParameter>> paraMap,boolean lockByOther){
  NodePart nodePart=new NodePart();
  IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
  boolean isInOut=false;
  if (service != null) {
    isInOut=service.isJobletInOutComponent(node);
  }
  Node cloneNode=null;
  if (isInOut) {
    cloneNode=new Node(node.getComponent(),(IProcess2)process,node.getUniqueName());
  }
 else {
    cloneNode=new Node(node.getComponent(),(IProcess2)process);
  }
  nodePart.setModel(cloneNode);
  cloneNode.setLabel(node.getLabel());
  if (lockByOther) {
    cloneNode.setReadOnly(true);
  }
 else {
    cloneNode.setReadOnly(false);
  }
  cloneNode.setDummy(node.isDummy());
  cloneNode.setActivate(node.isActivate());
  List<? extends IElementParameter> elementParas=null;
  if (paraMap.containsKey(node.getUniqueName())) {
    elementParas=paraMap.get(node.getUniqueName());
  }
 else {
    elementParas=node.getElementParameters();
  }
  for (  IElementParameter elementPara : elementParas) {
    if (elementPara.getName() != null && !elementPara.getName().equals("String_Node_Str")) {
      IElementParameter cloneElement=cloneNode.getElementParameter(elementPara.getName());
      Object paValue=elementPara.getValue();
      if (paValue instanceof List) {
        List list=new ArrayList();
        list.addAll((List)paValue);
        cloneElement.setValue(list);
      }
 else {
        cloneElement.setValue(elementPara.getValue());
      }
      if (lockByOther) {
        cloneElement.setReadOnly(true);
      }
 else {
        cloneElement.setReadOnly(elementPara.isReadOnly());
      }
      if (elementPara.getChildParameters() != null) {
        Map<String,IElementParameter> elementParaChild=elementPara.getChildParameters();
        Map<String,IElementParameter> cloneElementChild=cloneElement.getChildParameters();
        Iterator<Entry<String,IElementParameter>> ite=elementParaChild.entrySet().iterator();
        while (ite.hasNext()) {
          Entry<String,IElementParameter> entry=ite.next();
          String key=entry.getKey();
          IElementParameter c=entry.getValue();
          if (key != null && c != null) {
            IElementParameter cloneC=cloneElementChild.get(key);
            if (cloneC != null) {
              cloneC.setValue(c.getValue());
              if (lockByOther) {
                cloneC.setReadOnly(true);
              }
 else {
                cloneC.setReadOnly(c.isReadOnly());
              }
            }
          }
        }
      }
    }
  }
  for (  IElementParameter param : cloneNode.getElementParameters()) {
    String repositoryValue=param.getRepositoryValue();
    if (param.isShow(cloneNode.getElementParameters()) && (repositoryValue != null) && (!param.getName().equals(EParameterName.PROPERTY_TYPE.getName()))&& param.getFieldType() != EParameterFieldType.MEMO_SQL) {
      param.setRepositoryValueUsed(true);
      param.setReadOnly(true);
    }
  }
  cloneNode.setMetadataList(node.getMetadataList());
  cloneNode.setListConnector(node.getListConnector());
  cloneNode.setConnectionName(node.getConnectionName());
  cloneNode.setLocation(node.getLocation());
  IExternalNode externalNode=cloneNode.getExternalNode();
  if (externalNode != null) {
    if (node.getExternalData() != null) {
      try {
        externalNode.setExternalData(node.getExternalData().clone());
      }
 catch (      CloneNotSupportedException e) {
        ExceptionHandler.process(e);
      }
      cloneNode.setExternalData(externalNode.getExternalData());
    }
    if (node.getExternalNode().getExternalEmfData() != null) {
      externalNode.setExternalEmfData(EcoreUtil.copy(node.getExternalNode().getExternalEmfData()));
    }
    if (node.getExternalNode() != null) {
      ImageDescriptor screenshot=node.getExternalNode().getScreenshot();
      if (screenshot != null) {
        externalNode.setScreenshot(screenshot);
      }
    }
  }
  return cloneNode;
}