From 93f480719eee2c654f1240d26d3f73f147095ffa Mon Sep 17 00:00:00 2001 From: Naveen Tatikonda Date: Mon, 19 Aug 2024 23:30:40 -0500 Subject: [PATCH] Replace Strings util package with OpenSearch core Strings package Signed-off-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]);