From 2368417c9f789b00ae0f714ddc45b7e67bdc359f Mon Sep 17 00:00:00 2001 From: Naveen Tatikonda Date: Tue, 20 Aug 2024 12:46:30 -0500 Subject: [PATCH] Replace Strings util package with OpenSearch core Strings package (#675) Signed-off-by: Naveen Tatikonda (cherry picked from commit d8fcdae0c7ac313c674da763e15231a843b0c38c) --- .../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]);