Program: 188763
Project: 188763
Buggy source:
@Override public CloseableIterable<BinaryVersion> listBinaryVersions(StoragePath storagePath) throws GenericException, RequestNotValidException, NotFoundException, AuthorizationDeniedException {
  Path fauxPath=historyPath.resolve(storagePath.asString());
  Path parent=fauxPath.getParent();
  final String baseName=fauxPath.getFileName().toString();
  CloseableIterable<BinaryVersion> iterable;
  try {
    final DirectoryStream<Path> directoryStream=Files.newDirectoryStream(parent,new DirectoryStream.Filter<Path>(){
      @Override public boolean accept(      Path entry) throws IOException {
        return entry.getFileName().toString().startsWith(baseName);
      }
    }
);
    final Iterator<Path> pathIterator=directoryStream.iterator();
    iterable=new CloseableIterable<BinaryVersion>(){
      @Override public Iterator<BinaryVersion> iterator(){
        return new Iterator<BinaryVersion>(){
          @Override public boolean hasNext(){
            return pathIterator.hasNext();
          }
          @Override public BinaryVersion next(){
            Path next=pathIterator.next();
            BinaryVersion ret;
            try {
              ret=FSUtils.convertPathToBinaryVersion(historyPath,next);
            }
 catch (            GenericException|NotFoundException|RequestNotValidException e) {
              LOGGER.error("String_Node_Str" + basePath + "String_Node_Str"+ next,e);
              ret=null;
            }
            return ret;
          }
        }
;
      }
      @Override public void close() throws IOException {
        directoryStream.close();
      }
    }
;
  }
 catch (  NoSuchFileException e) {
    throw new NotFoundException("String_Node_Str" + storagePath,e);
  }
catch (  IOException e) {
    throw new GenericException("String_Node_Str" + storagePath,e);
  }
  return iterable;
}

Fixed version (ground truth):
@Override public CloseableIterable<BinaryVersion> listBinaryVersions(StoragePath storagePath) throws GenericException, RequestNotValidException, NotFoundException, AuthorizationDeniedException {
  Path fauxPath=historyPath.resolve(storagePath.asString());
  Path parent=fauxPath.getParent();
  final String baseName=fauxPath.getFileName().toString();
  CloseableIterable<BinaryVersion> iterable;
  if (!Files.exists(parent)) {
    return new EmptyClosableIterable<>();
  }
  try {
    final DirectoryStream<Path> directoryStream=Files.newDirectoryStream(parent,new DirectoryStream.Filter<Path>(){
      @Override public boolean accept(      Path entry) throws IOException {
        return entry.getFileName().toString().startsWith(baseName);
      }
    }
);
    final Iterator<Path> pathIterator=directoryStream.iterator();
    iterable=new CloseableIterable<BinaryVersion>(){
      @Override public Iterator<BinaryVersion> iterator(){
        return new Iterator<BinaryVersion>(){
          @Override public boolean hasNext(){
            return pathIterator.hasNext();
          }
          @Override public BinaryVersion next(){
            Path next=pathIterator.next();
            BinaryVersion ret;
            try {
              ret=FSUtils.convertPathToBinaryVersion(historyPath,next);
            }
 catch (            GenericException|NotFoundException|RequestNotValidException e) {
              LOGGER.error("String_Node_Str" + basePath + "String_Node_Str"+ next,e);
              ret=null;
            }
            return ret;
          }
        }
;
      }
      @Override public void close() throws IOException {
        directoryStream.close();
      }
    }
;
  }
 catch (  NoSuchFileException e) {
    throw new NotFoundException("String_Node_Str" + storagePath,e);
  }
catch (  IOException e) {
    throw new GenericException("String_Node_Str" + storagePath,e);
  }
  return iterable;
}