Program: 174772
Project: 174772
Buggy source:
protected void moveOrCopy(FileFolderService fileFolderService,NodeRef sourceNodeRef,NodeRef sourceParentNodeRef,NodeRef destParentNodeRef,String name) throws Exception {
  NodeRef rootNodeRef=getRootNodeRef();
  String sourcePath=getPath();
  List<String> sourcePathElements=getDAVHelper().splitAllPaths(sourcePath);
  FileInfo sourceFileInfo=null;
  String destPath=getDestinationPath();
  List<String> destPathElements=getDAVHelper().splitAllPaths(destPath);
  FileInfo destFileInfo=null;
  NodeService nodeService=getNodeService();
  try {
    sourceFileInfo=fileFolderService.resolveNamePath(rootNodeRef,sourcePathElements);
    destFileInfo=fileFolderService.resolveNamePath(rootNodeRef,destPathElements);
  }
 catch (  FileNotFoundException e) {
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + getPath());
    }
    if (sourceFileInfo == null) {
      throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND);
    }
  }
  checkNode(sourceFileInfo);
  if (destFileInfo != null && (isShuffleOperation(sourceFileInfo) || isVersioned(destFileInfo))) {
    copyOnlyContent(sourceNodeRef,destFileInfo,fileFolderService);
  }
 else   if (nodeService.hasAspect(sourceNodeRef,ContentModel.ASPECT_WORKING_COPY)) {
    fileFolderService.copy(sourceNodeRef,destParentNodeRef,name);
  }
 else   if (destFileInfo != null && nodeService.hasAspect(destFileInfo.getNodeRef(),ContentModel.ASPECT_WORKING_COPY)) {
    copyOnlyContent(sourceNodeRef,destFileInfo,fileFolderService);
  }
 else {
    if (sourceParentNodeRef.equals(destParentNodeRef)) {
      try {
        fileFolderService.rename(sourceNodeRef,name);
      }
 catch (      AccessDeniedException e) {
        XMLWriter xml=createXMLWriter();
        Attributes nullAttr=getDAVHelper().getNullAttributes();
        xml.startElement(WebDAV.DAV_NS,WebDAV.XML_ERROR,WebDAV.XML_NS_ERROR,nullAttr);
        xml.write(DocumentHelper.createElement(WebDAV.XML_NS_CANNOT_MODIFY_PROTECTED_PROPERTY));
        xml.endElement(WebDAV.DAV_NS,WebDAV.XML_ERROR,WebDAV.XML_NS_ERROR);
        m_response.setStatus(HttpServletResponse.SC_CONFLICT);
        return;
      }
    }
 else {
      fileFolderService.moveFrom(sourceNodeRef,sourceParentNodeRef,destParentNodeRef,name);
    }
  }
}

Fixed version (ground truth):
protected void moveOrCopy(FileFolderService fileFolderService,NodeRef sourceNodeRef,NodeRef sourceParentNodeRef,NodeRef destParentNodeRef,String name) throws Exception {
  NodeRef rootNodeRef=getRootNodeRef();
  String sourcePath=getPath();
  List<String> sourcePathElements=getDAVHelper().splitAllPaths(sourcePath);
  FileInfo sourceFileInfo=null;
  String destPath=getDestinationPath();
  List<String> destPathElements=getDAVHelper().splitAllPaths(destPath);
  FileInfo destFileInfo=null;
  NodeService nodeService=getNodeService();
  try {
    sourceFileInfo=fileFolderService.resolveNamePath(rootNodeRef,sourcePathElements);
    destFileInfo=fileFolderService.resolveNamePath(rootNodeRef,destPathElements);
  }
 catch (  FileNotFoundException e) {
    if (sourceFileInfo == null) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str" + sourcePath);
      }
      throw new WebDAVServerException(HttpServletResponse.SC_NOT_FOUND);
    }
  }
  checkNode(sourceFileInfo);
  if (destFileInfo != null && (isShuffleOperation(sourceFileInfo) || isVersioned(destFileInfo))) {
    copyOnlyContent(sourceNodeRef,destFileInfo,fileFolderService);
  }
 else   if (nodeService.hasAspect(sourceNodeRef,ContentModel.ASPECT_WORKING_COPY)) {
    fileFolderService.copy(sourceNodeRef,destParentNodeRef,name);
  }
 else   if (destFileInfo != null && nodeService.hasAspect(destFileInfo.getNodeRef(),ContentModel.ASPECT_WORKING_COPY)) {
    copyOnlyContent(sourceNodeRef,destFileInfo,fileFolderService);
  }
 else {
    if (sourceParentNodeRef.equals(destParentNodeRef)) {
      try {
        fileFolderService.rename(sourceNodeRef,name);
      }
 catch (      AccessDeniedException e) {
        XMLWriter xml=createXMLWriter();
        Attributes nullAttr=getDAVHelper().getNullAttributes();
        xml.startElement(WebDAV.DAV_NS,WebDAV.XML_ERROR,WebDAV.XML_NS_ERROR,nullAttr);
        xml.write(DocumentHelper.createElement(WebDAV.XML_NS_CANNOT_MODIFY_PROTECTED_PROPERTY));
        xml.endElement(WebDAV.DAV_NS,WebDAV.XML_ERROR,WebDAV.XML_NS_ERROR);
        m_response.setStatus(HttpServletResponse.SC_CONFLICT);
        return;
      }
    }
 else {
      fileFolderService.moveFrom(sourceNodeRef,sourceParentNodeRef,destParentNodeRef,name);
    }
  }
}