Skip to content

Commit 2f6cbf8

Browse files
committed
Rewrite this instanceof check
1 parent bef03e5 commit 2f6cbf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/DocumentSubsetBitsetCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ private static BitSet computeBitSet(Query query, LeafReaderContext context) thro
290290

291291
// Package private for testing
292292
static boolean isEffectiveMatchAllDocsQuery(Query rewrittenQuery) {
293-
if (rewrittenQuery instanceof ConstantScoreQuery && ((ConstantScoreQuery) rewrittenQuery).getQuery() instanceof MatchAllDocsQuery) {
293+
if (rewrittenQuery instanceof ConstantScoreQuery csq && csq.getQuery() instanceof MatchAllDocsQuery) {
294294
return true;
295295
}
296296
if (rewrittenQuery instanceof MatchAllDocsQuery) {

0 commit comments

Comments
 (0)