Skip to content

Commit

Permalink
Remove IOException from MultiTermQuery#getTermsCount (#13701)
Browse files Browse the repository at this point in the history
Neither this method nor any of the two overrides can throw an IOException.
This change removes the throws clauses from this method in order simplify
not have to handle them on the callers side.
  • Loading branch information
cbuescher authored Aug 30, 2024
1 parent ea1441c commit 6d373db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public final TermsEnum getTermsEnum(Terms terms) throws IOException {
* Return the number of unique terms contained in this query, if known up-front. If not known, -1
* will be returned.
*/
public long getTermsCount() throws IOException {
public long getTermsCount() {
return -1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected void swap(int i, int j) {
}

@Override
public long getTermsCount() throws IOException {
public long getTermsCount() {
return termData.size();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected TermsEnum getTermsEnum(Terms terms, AttributeSource atts) throws IOExc
}

@Override
public long getTermsCount() throws IOException {
public long getTermsCount() {
return terms.size();
}

Expand Down

0 comments on commit 6d373db

Please sign in to comment.