From 7d6c5afedbd1e229b244f4c28d8a0b0cc61e2f1f Mon Sep 17 00:00:00 2001 From: Heemin Kim Date: Fri, 19 May 2023 09:55:41 -0700 Subject: [PATCH] Change package for Strings.hasText (#314) Signed-off-by: Heemin Kim --- CHANGELOG.md | 1 + .../action/upload/geojson/ContentBuilder.java | 2 +- .../geojson/UploadGeoJSONRequestContent.java | 2 +- .../geospatial/stats/upload/UploadMetric.java | 2 +- .../geospatial/GeospatialRestTestCase.java | 14 +++++++------- .../geospatial/ip2geo/Ip2GeoTestCase.java | 1 - 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0868a2b3..8befb4d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,4 +21,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * Exclude lombok generated code from jacoco coverage report ([#268](https://github.com/opensearch-project/geospatial/pull/268)) ### 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 89e2819b..7193958d 100644 --- a/src/test/java/org/opensearch/geospatial/GeospatialRestTestCase.java +++ b/src/test/java/org/opensearch/geospatial/GeospatialRestTestCase.java @@ -36,7 +36,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; @@ -44,6 +43,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; @@ -101,7 +101,7 @@ protected static Response createPipeline(String name, Optional descripti builder.endObject(); Request request = new Request("PUT", buildPipelinePath(name)); - request.setJsonEntity(Strings.toString(builder)); + request.setJsonEntity(org.opensearch.common.Strings.toString(builder)); return client().performRequest(request); } @@ -118,7 +118,7 @@ protected Response createDatasource(final String name, Map prope builder.endObject(); Request request = new Request(PUT, buildDatasourcePath(name)); - request.setJsonEntity(Strings.toString(builder)); + request.setJsonEntity(org.opensearch.common.Strings.toString(builder)); return client().performRequest(request); } @@ -178,7 +178,7 @@ protected Response updateDatasource(final String name, Map prope builder.endObject(); Request request = new Request(PUT, String.join(URL_DELIMITER, buildDatasourcePath(name), SETTINGS)); - request.setJsonEntity(Strings.toString(builder)); + request.setJsonEntity(org.opensearch.common.Strings.toString(builder)); return client().performRequest(request); } @@ -188,7 +188,7 @@ protected Map simulatePipeline(final String name, List d builder.endObject(); Request request = new Request(GET, String.join(URL_DELIMITER, buildPipelinePath(name), SIMULATE)); - request.setJsonEntity(Strings.toString(builder)); + request.setJsonEntity(org.opensearch.common.Strings.toString(builder)); Response response = client().performRequest(request); return createParser(XContentType.JSON.xContent(), EntityUtils.toString(response.getEntity())).map(); } @@ -199,7 +199,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) diff --git a/src/test/java/org/opensearch/geospatial/ip2geo/Ip2GeoTestCase.java b/src/test/java/org/opensearch/geospatial/ip2geo/Ip2GeoTestCase.java index 608a957f..931dfdc1 100644 --- a/src/test/java/org/opensearch/geospatial/ip2geo/Ip2GeoTestCase.java +++ b/src/test/java/org/opensearch/geospatial/ip2geo/Ip2GeoTestCase.java @@ -52,7 +52,6 @@ import org.opensearch.geospatial.ip2geo.jobscheduler.Datasource; import org.opensearch.geospatial.ip2geo.jobscheduler.DatasourceUpdateService; import org.opensearch.geospatial.ip2geo.processor.Ip2GeoProcessor; -import org.opensearch.geospatial.plugin.GeospatialPlugin; import org.opensearch.ingest.IngestMetadata; import org.opensearch.ingest.IngestService; import org.opensearch.jobscheduler.spi.LockModel;