Program: 20651
Project: 20651
Buggy source:
private DavResource processRepositoryGroup(final DavServletRequest request,ArchivaDavResourceLocator archivaLocator,List<String> repositories,String activePrincipal,List<String> resourcesInAbsolutePath,RepositoryGroupConfiguration repoGroupConfig) throws DavException {
  DavResource resource=null;
  List<DavException> storedExceptions=new ArrayList<DavException>();
  String pathInfo=StringUtils.removeEnd(request.getPathInfo(),"String_Node_Str");
  String rootPath=StringUtils.substringBeforeLast(pathInfo,"String_Node_Str");
  if (StringUtils.endsWith(rootPath,"String_Node_Str" + repoGroupConfig.getMergedIndexPath())) {
    String requestedFileName=StringUtils.substringAfterLast(pathInfo,"String_Node_Str");
    File temporaryIndexDirectory=buildMergedIndexDirectory(repositories,activePrincipal,request,repoGroupConfig);
    File resourceFile=new File(temporaryIndexDirectory,requestedFileName);
    resource=new ArchivaDavResource(resourceFile.getAbsolutePath(),requestedFileName,null,request.getRemoteAddr(),activePrincipal,request.getDavSession(),archivaLocator,this,mimeTypes,auditListeners,scheduler);
  }
 else {
    for (    String repositoryId : repositories) {
      ManagedRepositoryContent managedRepository;
      try {
        managedRepository=repositoryFactory.getManagedRepositoryContent(repositoryId);
      }
 catch (      RepositoryNotFoundException e) {
        throw new DavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e);
      }
catch (      RepositoryException e) {
        throw new DavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e);
      }
      try {
        DavResource updatedResource=processRepository(request,archivaLocator,activePrincipal,managedRepository);
        if (resource == null) {
          resource=updatedResource;
        }
        String logicalResource=RepositoryPathUtil.getLogicalResource(archivaLocator.getResourcePath());
        if (logicalResource.endsWith("String_Node_Str")) {
          logicalResource=logicalResource.substring(1);
        }
        resourcesInAbsolutePath.add(new File(managedRepository.getRepoRoot(),logicalResource).getAbsolutePath());
      }
 catch (      DavException e) {
        storedExceptions.add(e);
      }
    }
  }
  if (resource == null) {
    if (!storedExceptions.isEmpty()) {
      for (      DavException e : storedExceptions) {
        if (401 == e.getErrorCode()) {
          throw e;
        }
      }
      throw new DavException(HttpServletResponse.SC_NOT_FOUND);
    }
 else {
      throw new DavException(HttpServletResponse.SC_NOT_FOUND);
    }
  }
  return resource;
}

Fixed version (ground truth):
private DavResource processRepositoryGroup(final DavServletRequest request,ArchivaDavResourceLocator archivaLocator,List<String> repositories,String activePrincipal,List<String> resourcesInAbsolutePath,RepositoryGroupConfiguration repoGroupConfig) throws DavException {
  DavResource resource=null;
  List<DavException> storedExceptions=new ArrayList<DavException>();
  String pathInfo=StringUtils.removeEnd(request.getPathInfo(),"String_Node_Str");
  String rootPath=StringUtils.substringBeforeLast(pathInfo,"String_Node_Str");
  if (StringUtils.endsWith(rootPath,repoGroupConfig.getMergedIndexPath())) {
    String requestedFileName=StringUtils.substringAfterLast(pathInfo,"String_Node_Str");
    File temporaryIndexDirectory=buildMergedIndexDirectory(repositories,activePrincipal,request,repoGroupConfig);
    File resourceFile=new File(temporaryIndexDirectory,requestedFileName);
    resource=new ArchivaDavResource(resourceFile.getAbsolutePath(),requestedFileName,null,request.getRemoteAddr(),activePrincipal,request.getDavSession(),archivaLocator,this,mimeTypes,auditListeners,scheduler);
  }
 else {
    for (    String repositoryId : repositories) {
      ManagedRepositoryContent managedRepository;
      try {
        managedRepository=repositoryFactory.getManagedRepositoryContent(repositoryId);
      }
 catch (      RepositoryNotFoundException e) {
        throw new DavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e);
      }
catch (      RepositoryException e) {
        throw new DavException(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,e);
      }
      try {
        DavResource updatedResource=processRepository(request,archivaLocator,activePrincipal,managedRepository);
        if (resource == null) {
          resource=updatedResource;
        }
        String logicalResource=RepositoryPathUtil.getLogicalResource(archivaLocator.getResourcePath());
        if (logicalResource.endsWith("String_Node_Str")) {
          logicalResource=logicalResource.substring(1);
        }
        resourcesInAbsolutePath.add(new File(managedRepository.getRepoRoot(),logicalResource).getAbsolutePath());
      }
 catch (      DavException e) {
        storedExceptions.add(e);
      }
    }
  }
  if (resource == null) {
    if (!storedExceptions.isEmpty()) {
      for (      DavException e : storedExceptions) {
        if (401 == e.getErrorCode()) {
          throw e;
        }
      }
      throw new DavException(HttpServletResponse.SC_NOT_FOUND);
    }
 else {
      throw new DavException(HttpServletResponse.SC_NOT_FOUND);
    }
  }
  return resource;
}