Use AccessController.doPrivileged

This commit is contained in:
David Smiley 2024-03-12 09:44:02 -04:00
parent b527e101e7
commit 429bad659c
No known key found for this signature in database
GPG Key ID: 6FDFF3BF6796FD4A
2 changed files with 10 additions and 2 deletions

View File

@ -733,7 +733,9 @@ public class IndexSearcher {
rewrittenQuery = query.rewrite(this)) { rewrittenQuery = query.rewrite(this)) {
query = rewrittenQuery; query = rewrittenQuery;
} }
query.visit(getNumClausesCheckVisitor()); if (maxClauseCount > -1) {
query.visit(getNumClausesCheckVisitor());
}
return query; return query;
} }

View File

@ -99,5 +99,11 @@ public abstract class QueryVisitor {
} }
/** A QueryVisitor implementation that does nothing */ /** A QueryVisitor implementation that does nothing */
public static final QueryVisitor EMPTY_VISITOR = new QueryVisitor() {}; public static final QueryVisitor EMPTY_VISITOR =
new QueryVisitor() {
@Override
public boolean acceptField(String field) {
return false;
}
};
} }