Program: 95474
Project: 95474
Buggy source:
/** 
 * @param newTcName the name of the new SpecTestCase
 * @param ownerNode the edited  {@link INodePO} from which to extract
 * @param modNodes nodes to move from the old tc to the new tc
 * @return result of extraction
 */
private IExecTestCasePO persistExtraction(final INodePO ownerNode,final String newTcName,final List<INodePO> modNodes){
  final ParamNameBPDecorator mapper=new ParamNameBPDecorator(ParamNameBP.getInstance());
  final IExecTestCasePO[] lol=new IExecTestCasePO[1];
  final List<IPersistentObject> toLock=new ArrayList<>(2);
  final IPersistentObject cont=GeneralStorage.getInstance().getProject().getSpecObjCont();
  toLock.add(cont);
  toLock.add(ownerNode);
  boolean succ=TransactionWrapper.executeOperation(new ITransaction(){
    /** 
 * {@inheritDoc} 
 */
    public Collection<? extends IPersistentObject> getToLock(){
      return toLock;
    }
    /** 
 * {@inheritDoc} 
 */
    public Collection<? extends IPersistentObject> getToRefresh(){
      return toLock;
    }
    /** 
 * {@inheritDoc} 
 */
    public void run(    EntityManager sess) throws PMException {
      List<INodePO> nodesToRef=new ArrayList<INodePO>();
      getModNodesFromCurrentSession(sess,nodesToRef);
      lol[0]=TreeOpsBP.extractTestCase(newTcName,ownerNode,nodesToRef,sess,mapper);
      final ISpecTestCasePO newSpecTc=lol[0].getSpecTestCase();
      registerParamNamesToSave(newSpecTc,mapper);
      mapper.persist(sess,GeneralStorage.getInstance().getProject().getId());
      NativeSQLUtils.addNodeAFFECTS(sess,lol[0].getSpecTestCase(),cont);
    }
    /** 
 * Loads the moved nodes to the session
 * @param s session used for refactoring
 * @param nodesToRef nodes to refactor from current session
 */
    private void getModNodesFromCurrentSession(    EntityManager s,    List<INodePO> nodesToRef){
      if (modNodes.isEmpty()) {
        return;
      }
      INodePO par=modNodes.get(0).getParentNode();
      par=s.find(par.getClass(),par.getId());
      par.getUnmodifiableNodeList();
      for (      INodePO node : modNodes) {
        INodePO object=s.find(node.getClass(),node.getId());
        if (object != null) {
          nodesToRef.add(object);
        }
      }
    }
  }
);
  if (!succ) {
    return null;
  }
  mapper.updateStandardMapperAndCleanup(ownerNode.getParentProjectId());
  return lol[0];
}

Fixed version (ground truth):
/** 
 * @param newTcName the name of the new SpecTestCase
 * @param ownerNode the edited  {@link INodePO} from which to extract
 * @param modNodes nodes to move from the old tc to the new tc
 * @return result of extraction
 */
private IExecTestCasePO persistExtraction(final INodePO ownerNode,final String newTcName,final List<INodePO> modNodes){
  final ParamNameBPDecorator mapper=new ParamNameBPDecorator(ParamNameBP.getInstance());
  final IExecTestCasePO[] lol=new IExecTestCasePO[1];
  final List<IPersistentObject> toLock=new ArrayList<>(2);
  final IPersistentObject cont=GeneralStorage.getInstance().getProject().getSpecObjCont();
  toLock.add(cont);
  toLock.add(ownerNode);
  boolean succ=TransactionWrapper.executeOperation(new ITransaction(){
    /** 
 * {@inheritDoc} 
 */
    public Collection<? extends IPersistentObject> getToLock(){
      return toLock;
    }
    /** 
 * {@inheritDoc} 
 */
    public Collection<? extends IPersistentObject> getToRefresh(){
      List<IPersistentObject> toRefr=new ArrayList<>(toLock);
      toRefr.addAll(lol[0].getSpecTestCase().getUnmodifiableNodeList());
      return toRefr;
    }
    /** 
 * {@inheritDoc} 
 */
    public void run(    EntityManager sess) throws PMException {
      List<INodePO> nodesToRef=new ArrayList<INodePO>();
      getModNodesFromCurrentSession(sess,nodesToRef);
      lol[0]=TreeOpsBP.extractTestCase(newTcName,ownerNode,nodesToRef,sess,mapper);
      final ISpecTestCasePO newSpecTc=lol[0].getSpecTestCase();
      registerParamNamesToSave(newSpecTc,mapper);
      mapper.persist(sess,GeneralStorage.getInstance().getProject().getId());
      NativeSQLUtils.addNodeAFFECTS(sess,lol[0].getSpecTestCase(),cont);
    }
    /** 
 * Loads the moved nodes to the session
 * @param s session used for refactoring
 * @param nodesToRef nodes to refactor from current session
 */
    private void getModNodesFromCurrentSession(    EntityManager s,    List<INodePO> nodesToRef){
      if (modNodes.isEmpty()) {
        return;
      }
      INodePO par=modNodes.get(0).getParentNode();
      par=s.find(par.getClass(),par.getId());
      par.getUnmodifiableNodeList();
      for (      INodePO node : modNodes) {
        INodePO object=s.find(node.getClass(),node.getId());
        if (object != null) {
          nodesToRef.add(object);
        }
      }
    }
  }
);
  if (!succ) {
    return null;
  }
  mapper.updateStandardMapperAndCleanup(ownerNode.getParentProjectId());
  return lol[0];
}