Remove IOException from MultiTermQuery#getTermsCount (#13701)

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.
This commit is contained in:
Christoph Büscher 2024-08-30 15:00:32 +02:00 committed by GitHub
parent ea1441c81c
commit 6d373dbb4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -313,7 +313,7 @@ public abstract class MultiTermQuery extends Query {
* 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;
}

View File

@ -137,7 +137,7 @@ public class TermInSetQuery extends MultiTermQuery implements Accountable {
}
@Override
public long getTermsCount() throws IOException {
public long getTermsCount() {
return termData.size();
}

View File

@ -95,7 +95,7 @@ class TermsQuery extends MultiTermQuery implements Accountable {
}
@Override
public long getTermsCount() throws IOException {
public long getTermsCount() {
return terms.size();
}