Program: 95416
Project: 95416
Buggy source:
/** 
 * @param addTo the node to add to
 * @param nodeToCopy the param node to clone and add
 * @param pMapper the param name mapper
 * @param oldToNewGuids the old to new guid map
 * @param specTC the top-level specTC for the params
 * @throws PMException in case of an persitence exception
 */
private void addCloneToNode(INodePO addTo,INodePO nodeToCopy,ParamNameBPDecorator pMapper,Map<String,String> oldToNewGuids,ISpecTestCasePO specTC) throws PMException {
  INodePO newNode=null;
  if (nodeToCopy instanceof IExecTestCasePO) {
    IExecTestCasePO origExec=(IExecTestCasePO)nodeToCopy;
    IExecTestCasePO newExec=NodeMaker.createExecTestCasePO(origExec.getSpecTestCase());
    fillExec(origExec,newExec);
    newNode=newExec;
  }
 else   if (nodeToCopy instanceof ICapPO) {
    ICapPO origCap=(ICapPO)nodeToCopy;
    ICapPO newCap=NodeMaker.createCapPO(origCap.getName(),origCap.getComponentName(),origCap.getComponentType(),origCap.getActionName());
    fillCap(origCap,newCap);
    newNode=newCap;
  }
 else   if (nodeToCopy instanceof ICommentPO) {
    ICommentPO origComment=(ICommentPO)nodeToCopy;
    ICommentPO newComment=NodeMaker.createCommentPO(origComment.getName());
    newNode=newComment;
  }
 else   if (nodeToCopy instanceof IControllerPO) {
    newNode=NodeMaker.createControllerPO((IControllerPO)nodeToCopy);
    int i=0;
    for (    INodePO node : nodeToCopy.getUnmodifiableNodeList()) {
      for (      INodePO node2 : node.getUnmodifiableNodeList()) {
        addCloneToNode(newNode.getUnmodifiableNodeList().get(i),node2,pMapper,oldToNewGuids,specTC);
      }
    }
  }
  if (newNode != null) {
    if (newNode instanceof IParamNodePO) {
      addParamsToSpec(specTC,(IParamNodePO)newNode,pMapper,oldToNewGuids);
    }
    addTo.addNode(newNode);
  }
}

Fixed version (ground truth):
/** 
 * @param addTo the node to add to
 * @param nodeToCopy the param node to clone and add
 * @param pMapper the param name mapper
 * @param oldToNewGuids the old to new guid map
 * @param specTC the top-level specTC for the params
 * @throws PMException in case of an persitence exception
 */
private void addCloneToNode(INodePO addTo,INodePO nodeToCopy,ParamNameBPDecorator pMapper,Map<String,String> oldToNewGuids,ISpecTestCasePO specTC) throws PMException {
  INodePO newNode=null;
  if (nodeToCopy instanceof IExecTestCasePO) {
    IExecTestCasePO origExec=(IExecTestCasePO)nodeToCopy;
    IExecTestCasePO newExec=NodeMaker.createExecTestCasePO(origExec.getSpecTestCase());
    fillExec(origExec,newExec);
    newNode=newExec;
  }
 else   if (nodeToCopy instanceof ICapPO) {
    ICapPO origCap=(ICapPO)nodeToCopy;
    ICapPO newCap=NodeMaker.createCapPO(origCap.getName(),origCap.getComponentName(),origCap.getComponentType(),origCap.getActionName());
    fillCap(origCap,newCap);
    newNode=newCap;
  }
 else   if (nodeToCopy instanceof ICommentPO) {
    ICommentPO origComment=(ICommentPO)nodeToCopy;
    ICommentPO newComment=NodeMaker.createCommentPO(origComment.getName());
    newNode=newComment;
  }
 else   if (nodeToCopy instanceof IControllerPO) {
    newNode=NodeMaker.createControllerPO((IControllerPO)nodeToCopy);
    int i=0;
    for (    INodePO node : nodeToCopy.getUnmodifiableNodeList()) {
      for (      INodePO node2 : node.getUnmodifiableNodeList()) {
        addCloneToNode(newNode.getUnmodifiableNodeList().get(i),node2,pMapper,oldToNewGuids,specTC);
      }
      i++;
    }
  }
  if (newNode != null) {
    if (newNode instanceof IParamNodePO) {
      addParamsToSpec(specTC,(IParamNodePO)newNode,pMapper,oldToNewGuids);
    }
    addTo.addNode(newNode);
  }
}