Program: 53137
Project: 53137
Buggy source:
@VisibleForTesting ImmutableSortedSet<SourcePath> collectInputFiles(final ProjectFilesystem filesystem,Optional<Path> inputDir){
  if (!inputDir.isPresent()) {
    return ImmutableSortedSet.of();
  }
  final ImmutableSortedSet.Builder<SourcePath> paths=ImmutableSortedSet.naturalOrder();
  FileVisitor<Path> fileVisitor=new SimpleFileVisitor<Path>(){
    @Override public FileVisitResult preVisitDirectory(    Path dir,    BasicFileAttributes attr) throws IOException {
      String dirName=dir.getFileName().toString();
      if (dirName.charAt(0) == '_' || !isResource(dirName)) {
        return FileVisitResult.SKIP_SUBTREE;
      }
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult visitFile(    Path file,    BasicFileAttributes attr) throws IOException {
      String filename=file.getFileName().toString();
      if (isResource(filename)) {
        paths.add(new PathSourcePath(filesystem,file));
      }
      return FileVisitResult.CONTINUE;
    }
    private boolean isResource(    String fileOrDirName){
      if (NON_ASSET_FILENAMES.contains(fileOrDirName.toLowerCase())) {
        return false;
      }
      if (fileOrDirName.charAt(fileOrDirName.length() - 1) == '~') {
        return false;
      }
      if (MiniAapt.IGNORED_FILE_EXTENSIONS.contains(Files.getFileExtension(fileOrDirName))) {
        return false;
      }
      return true;
    }
  }
;
  try {
    filesystem.walkRelativeFileTree(inputDir.get(),fileVisitor);
  }
 catch (  IOException e) {
    throw new HumanReadableException(e,"String_Node_Str",inputDir.get());
  }
  return paths.build();
}

Fixed version (ground truth):
@VisibleForTesting ImmutableSortedSet<SourcePath> collectInputFiles(final ProjectFilesystem filesystem,Optional<Path> inputDir){
  if (!inputDir.isPresent()) {
    return ImmutableSortedSet.of();
  }
  final ImmutableSortedSet.Builder<SourcePath> paths=ImmutableSortedSet.naturalOrder();
  FileVisitor<Path> fileVisitor=new SimpleFileVisitor<Path>(){
    @Override public FileVisitResult preVisitDirectory(    Path dir,    BasicFileAttributes attr) throws IOException {
      if (dir.getFileName().toString().charAt(0) == '_' || !isResource(dir)) {
        return FileVisitResult.SKIP_SUBTREE;
      }
      return FileVisitResult.CONTINUE;
    }
    @Override public FileVisitResult visitFile(    Path file,    BasicFileAttributes attr) throws IOException {
      if (isResource(file)) {
        paths.add(new PathSourcePath(filesystem,file));
      }
      return FileVisitResult.CONTINUE;
    }
    private boolean isResource(    Path fileOrDir) throws IOException {
      for (      String nonAssetFilename : NON_ASSET_FILENAMES) {
        if (filesystem.isSameRelativePathIfFileExists(fileOrDir,fileOrDir.resolveSibling(nonAssetFilename))) {
          return false;
        }
      }
      String fileOrDirName=fileOrDir.getFileName().toString();
      if (fileOrDirName.charAt(fileOrDirName.length() - 1) == '~') {
        return false;
      }
      String fileOrDirNameWithoutExtension=Files.getNameWithoutExtension(fileOrDirName);
      for (      String ignoredMiniAaptExtension : MiniAapt.IGNORED_FILE_EXTENSIONS) {
        if (filesystem.isSameRelativePathIfFileExists(fileOrDir,fileOrDir.resolveSibling(fileOrDirNameWithoutExtension + "String_Node_Str" + ignoredMiniAaptExtension))) {
          return false;
        }
      }
      return true;
    }
  }
;
  try {
    filesystem.walkRelativeFileTree(inputDir.get(),fileVisitor);
  }
 catch (  IOException e) {
    throw new HumanReadableException(e,"String_Node_Str",inputDir.get());
  }
  return paths.build();
}