Skip to content

Commit

Permalink
use StringUtils to check
Browse files Browse the repository at this point in the history
Signed-off-by: zhichao-aws <[email protected]>
  • Loading branch information
zhichao-aws committed Sep 25, 2023
1 parent f58a073 commit 791c6ca
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import lombok.experimental.Accessors;
import lombok.extern.log4j.Log4j2;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.lucene.document.FeatureField;
Expand Down Expand Up @@ -251,7 +252,7 @@ protected Query doToQuery(QueryShardContext context) throws IOException {
}

private static void validateForRewrite(String queryText, String modelId) {
if (null == queryText || null == modelId) {
if (StringUtils.isBlank(queryText) || StringUtils.isBlank(modelId)) {
throw new IllegalArgumentException(
"When "
+ QUERY_TOKENS_FIELD.getPreferredName()
Expand Down

0 comments on commit 791c6ca

Please sign in to comment.