From c21b58be8b4f4b6e20ab3a3b6d6d643f36f5a5e9 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 13:09:22 -0500 Subject: [PATCH] Replace Strings util package with OpenSearch core Strings package (#675) (#676) Signed-off-by: Naveen Tatikonda (cherry picked from commit d8fcdae0c7ac313c674da763e15231a843b0c38c) Co-authored-by: Naveen Tatikonda --- .../org/opensearch/geospatial/ip2geo/dao/GeoIpDataDao.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opensearch/geospatial/ip2geo/dao/GeoIpDataDao.java b/src/main/java/org/opensearch/geospatial/ip2geo/dao/GeoIpDataDao.java index 0d98db55..13fbd4cc 100644 --- a/src/main/java/org/opensearch/geospatial/ip2geo/dao/GeoIpDataDao.java +++ b/src/main/java/org/opensearch/geospatial/ip2geo/dao/GeoIpDataDao.java @@ -32,7 +32,6 @@ import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; -import org.apache.logging.log4j.util.Strings; import org.opensearch.OpenSearchException; import org.opensearch.SpecialPermission; import org.opensearch.action.DocWriteRequest; @@ -53,6 +52,7 @@ import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentHelper; import org.opensearch.common.xcontent.XContentType; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.geospatial.annotation.VisibleForTesting; import org.opensearch.geospatial.constants.IndexSetting; @@ -230,7 +230,7 @@ public XContentBuilder createDocument(final String[] fields, final String[] valu builder.field(IP_RANGE_FIELD_NAME, values[0]); builder.startObject(DATA_FIELD_NAME); for (int i = 1; i < fields.length; i++) { - if (Strings.isBlank(values[i])) { + if (!Strings.hasText(values[i])) { continue; } builder.field(fields[i], values[i]);