Program: 188551
Project: 188551
Buggy source:
public Map<String,String> moveTransferredResource(List<TransferredResource> resources,String newRelativePath,boolean replaceExisting,boolean reindexResources,boolean areResourcesFromSameFolder,boolean addOldRelativePathToNewRelativePath) throws AlreadyExistsException, GenericException, IsStillUpdatingException, NotFoundException {
  Map<String,String> oldToNewTransferredResourceIds=new HashMap<String,String>();
  List<TransferredResource> resourcesToIndex=new ArrayList<TransferredResource>();
  boolean notFoundResources=false;
  for (  TransferredResource resource : resources) {
    if (Files.exists(Paths.get(resource.getFullPath()))) {
      Path newResourcePath=basePath.resolve(newRelativePath);
      if (addOldRelativePathToNewRelativePath) {
        newResourcePath=newResourcePath.resolve(resource.getRelativePath());
      }
 else {
        newResourcePath=newResourcePath.resolve(resource.getName());
      }
      FSUtils.move(Paths.get(resource.getFullPath()),newResourcePath,replaceExisting);
      oldToNewTransferredResourceIds.put(resource.getUUID(),getTransferredResourceUUID(basePath.relativize(newResourcePath)));
      resourcesToIndex.add(resource);
    }
 else {
      notFoundResources=true;
    }
  }
  if (reindexResources) {
    updateAllTransferredResources(getTransferredResourceUUID(newRelativePath),true);
    reindexOldResourcesParentsAfterMove(resourcesToIndex,areResourcesFromSameFolder);
  }
  if (notFoundResources) {
    throw new NotFoundException("String_Node_Str");
  }
  return oldToNewTransferredResourceIds;
}

Fixed version (ground truth):
public Map<String,String> moveTransferredResource(List<TransferredResource> resources,String newRelativePath,boolean replaceExisting,boolean reindexResources,boolean areResourcesFromSameFolder,boolean addOldRelativePathToNewRelativePath) throws AlreadyExistsException, GenericException, IsStillUpdatingException, NotFoundException {
  Map<String,String> oldToNewTransferredResourceIds=new HashMap<String,String>();
  List<TransferredResource> resourcesToIndex=new ArrayList<TransferredResource>();
  boolean notFoundResources=false;
  for (  TransferredResource resource : resources) {
    if (Files.exists(Paths.get(resource.getFullPath()))) {
      Path newResourcePath=basePath.resolve(newRelativePath);
      if (addOldRelativePathToNewRelativePath) {
        newResourcePath=newResourcePath.resolve(resource.getRelativePath());
      }
 else {
        newResourcePath=newResourcePath.resolve(resource.getName());
      }
      FSUtils.move(Paths.get(resource.getFullPath()),newResourcePath,replaceExisting);
      oldToNewTransferredResourceIds.put(resource.getUUID(),IdUtils.getTransferredResourceUUID(basePath.relativize(newResourcePath)));
      resourcesToIndex.add(resource);
    }
 else {
      notFoundResources=true;
    }
  }
  if (reindexResources) {
    updateAllTransferredResources(IdUtils.getTransferredResourceUUID(newRelativePath),true);
    reindexOldResourcesParentsAfterMove(resourcesToIndex,areResourcesFromSameFolder);
  }
  if (notFoundResources) {
    throw new NotFoundException("String_Node_Str");
  }
  return oldToNewTransferredResourceIds;
}