class DirectoryExtraReader {

    // N.b.: update #search() comment when changing
    private static final int DIR_LIMIT_NUM = 2000;

    private static final Logger LOGGER = LoggerFactory.getLogger(
        DirectoryExtraReader.class);

    /**
     * Search for supplemental file information in the specified {@code path}.
     * @param searcher a defined instance
     * @param path a defined path to qualify the search
     * @return a list of results, limited to 2000 values
     * @throws IOException if an error occurs searching the index
     */
    public List<NullableNumLinesLOC> search(IndexSearcher searcher, String path) throws IOException {<FILL_FUNCTION_BODY>}

    private List<NullableNumLinesLOC> processHits(IndexSearcher searcher, TopDocs hits)
            throws IOException {

        List<NullableNumLinesLOC> results = new ArrayList<>();

        StoredFields storedFields = searcher.storedFields();
        for (ScoreDoc sd : hits.scoreDocs) {
            Document d = storedFields.document(sd.doc);
            NullableNumLinesLOC extra = NumLinesLOCUtil.read(d);
            results.add(extra);
        }

        return results;
    }
}

        if (searcher == null) {
            throw new IllegalArgumentException("`searcher' is null");
        }
        if (path == null) {
            throw new IllegalArgumentException("`path' is null");
        }

        QueryBuilder qbuild = new QueryBuilder();
        qbuild.setDirPath(path);
        Query query;
        try {
            query = qbuild.build();
        } catch (ParseException e) {
            final String PARSE_ERROR =
                "An error occurred while parsing dirpath query";
            LOGGER.log(Level.WARNING, PARSE_ERROR, e);
            throw new IOException(PARSE_ERROR);
        }

        Statistics stat = new Statistics();
        TopDocs hits = searcher.search(query, DIR_LIMIT_NUM);

        stat.report(LOGGER, Level.FINEST, "search via DirectoryExtraReader done",
                "search.latency", new String[]{"category", "extra",
                        "outcome", hits.scoreDocs.length > 0 ? "success" : "empty"});

        return processHits(searcher, hits);
    
<no_super_class>