From d61b06a9c61d7caedb0f3ade354892f76110b3d0 Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Thu, 17 Mar 2022 09:15:16 -0700 Subject: [PATCH] Address review comment Signed-off-by: Suraj Singh --- .../org/opensearch/percolator/PercolateQueryBuilder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/percolator/src/main/java/org/opensearch/percolator/PercolateQueryBuilder.java b/modules/percolator/src/main/java/org/opensearch/percolator/PercolateQueryBuilder.java index 33077c11df092..b2130eca3bb02 100644 --- a/modules/percolator/src/main/java/org/opensearch/percolator/PercolateQueryBuilder.java +++ b/modules/percolator/src/main/java/org/opensearch/percolator/PercolateQueryBuilder.java @@ -230,12 +230,16 @@ protected PercolateQueryBuilder(String field, Supplier documentS name = in.readOptionalString(); if (in.getVersion().before(Version.V_2_0_0)) { String documentType = in.readOptionalString(); - assert documentType == null; + if (documentType != null) { + throw new IllegalStateException("documentType must be null"); + } } indexedDocumentIndex = in.readOptionalString(); if (in.getVersion().before(Version.V_2_0_0)) { String indexedDocumentType = in.readOptionalString(); - assert indexedDocumentType == null; + if (indexedDocumentType != null) { + throw new IllegalStateException("indexedDocumentType must be null"); + } } indexedDocumentId = in.readOptionalString();