From 5d7c3d3e2f2cae72d7e6e403542db05149424720 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 20:17:08 -0700 Subject: [PATCH] Change package for Strings.hasText (#314) (#315) Signed-off-by: Heemin Kim (cherry picked from commit 55e77981281cd33fc0f297e981fa86f7caa47b43) Co-authored-by: Heemin Kim --- CHANGELOG.md | 1 + .../geospatial/action/upload/geojson/ContentBuilder.java | 2 +- .../upload/geojson/UploadGeoJSONRequestContent.java | 2 +- .../opensearch/geospatial/stats/upload/UploadMetric.java | 2 +- .../org/opensearch/geospatial/GeospatialRestTestCase.java | 8 ++++---- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18ac4b48..7f0886d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,4 +19,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Infrastructure ### Documentation ### Maintenance +* Change package for Strings.hasText ([#314](https://github.com/opensearch-project/geospatial/pull/314)) ### Refactoring diff --git a/src/main/java/org/opensearch/geospatial/action/upload/geojson/ContentBuilder.java b/src/main/java/org/opensearch/geospatial/action/upload/geojson/ContentBuilder.java index 551b1c06..66e708ed 100644 --- a/src/main/java/org/opensearch/geospatial/action/upload/geojson/ContentBuilder.java +++ b/src/main/java/org/opensearch/geospatial/action/upload/geojson/ContentBuilder.java @@ -14,7 +14,7 @@ import org.opensearch.action.index.IndexRequestBuilder; import org.opensearch.action.support.WriteRequest; import org.opensearch.client.Client; -import org.opensearch.common.Strings; +import org.opensearch.core.common.Strings; import org.opensearch.geospatial.GeospatialParser; /** diff --git a/src/main/java/org/opensearch/geospatial/action/upload/geojson/UploadGeoJSONRequestContent.java b/src/main/java/org/opensearch/geospatial/action/upload/geojson/UploadGeoJSONRequestContent.java index 0bcde2ab..eae60881 100644 --- a/src/main/java/org/opensearch/geospatial/action/upload/geojson/UploadGeoJSONRequestContent.java +++ b/src/main/java/org/opensearch/geospatial/action/upload/geojson/UploadGeoJSONRequestContent.java @@ -15,8 +15,8 @@ import lombok.AccessLevel; import lombok.AllArgsConstructor; -import org.opensearch.common.Strings; import org.opensearch.core.ParseField; +import org.opensearch.core.common.Strings; import org.opensearch.geospatial.GeospatialParser; /** diff --git a/src/main/java/org/opensearch/geospatial/stats/upload/UploadMetric.java b/src/main/java/org/opensearch/geospatial/stats/upload/UploadMetric.java index 0b744590..2dacef52 100644 --- a/src/main/java/org/opensearch/geospatial/stats/upload/UploadMetric.java +++ b/src/main/java/org/opensearch/geospatial/stats/upload/UploadMetric.java @@ -11,10 +11,10 @@ import lombok.Getter; -import org.opensearch.common.Strings; import org.opensearch.common.io.stream.StreamInput; import org.opensearch.common.io.stream.StreamOutput; import org.opensearch.common.io.stream.Writeable; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.ToXContentFragment; import org.opensearch.core.xcontent.XContentBuilder; diff --git a/src/test/java/org/opensearch/geospatial/GeospatialRestTestCase.java b/src/test/java/org/opensearch/geospatial/GeospatialRestTestCase.java index ad721751..dd049a05 100644 --- a/src/test/java/org/opensearch/geospatial/GeospatialRestTestCase.java +++ b/src/test/java/org/opensearch/geospatial/GeospatialRestTestCase.java @@ -33,7 +33,6 @@ import org.opensearch.client.Request; import org.opensearch.client.Response; import org.opensearch.common.CheckedConsumer; -import org.opensearch.common.Strings; import org.opensearch.common.UUIDs; import org.opensearch.common.geo.GeoJson; import org.opensearch.common.geo.ShapeRelation; @@ -41,6 +40,7 @@ import org.opensearch.common.xcontent.XContentFactory; import org.opensearch.common.xcontent.XContentType; import org.opensearch.common.xcontent.json.JsonXContent; +import org.opensearch.core.common.Strings; import org.opensearch.core.xcontent.XContentBuilder; import org.opensearch.geometry.Geometry; import org.opensearch.geospatial.action.upload.geojson.UploadGeoJSONRequestContent; @@ -87,7 +87,7 @@ protected static void createPipeline(String name, Optional description, builder.endObject(); Request request = new Request("PUT", buildPipelinePath(name)); - request.setJsonEntity(Strings.toString(builder)); + request.setJsonEntity(org.opensearch.common.Strings.toString(builder)); client().performRequest(request); } @@ -102,7 +102,7 @@ protected static void createIndex(String name, Settings settings, Map XContentBuilder builder = JsonXContent.contentBuilder().startObject(); build.accept(builder); builder.endObject(); - return Strings.toString(builder); + return org.opensearch.common.Strings.toString(builder); } public String buildSearchAggregationsBodyAsString(CheckedConsumer aggregationsBuilder)