From a5ed138e97f79eeeaf2583ebf63b94474c6132fe Mon Sep 17 00:00:00 2001 From: Aurelien FOUCRET Date: Fri, 18 Oct 2024 12:32:36 +0200 Subject: [PATCH] Readability. --- .../org/elasticsearch/xpack/kql/parser/KqlAstBuilder.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/plugin/kql/src/main/java/org/elasticsearch/xpack/kql/parser/KqlAstBuilder.java b/x-pack/plugin/kql/src/main/java/org/elasticsearch/xpack/kql/parser/KqlAstBuilder.java index 13c59089c7299..16b35db6d1319 100644 --- a/x-pack/plugin/kql/src/main/java/org/elasticsearch/xpack/kql/parser/KqlAstBuilder.java +++ b/x-pack/plugin/kql/src/main/java/org/elasticsearch/xpack/kql/parser/KqlAstBuilder.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.kql.parser; import org.antlr.v4.runtime.ParserRuleContext; -import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.MatchAllQueryBuilder; import org.elasticsearch.index.query.MatchNoneQueryBuilder; import org.elasticsearch.index.query.QueryBuilder; @@ -42,8 +41,7 @@ public QueryBuilder visitBooleanQuery(KqlBaseParser.BooleanQueryContext ctx) { @Override public QueryBuilder visitNotQuery(KqlBaseParser.NotQueryContext ctx) { - BoolQueryBuilder builder = QueryBuilders.boolQuery(); - return builder.mustNot(ParserUtils.typedParsing(this, ctx.simpleQuery(), QueryBuilder.class)); + return QueryBuilders.boolQuery().mustNot(ParserUtils.typedParsing(this, ctx.simpleQuery(), QueryBuilder.class)); } @Override