Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to core.common.Strings #1098

Merged
merged 1 commit into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.apache.logging.log4j.LogManager
import org.opensearch.action.FailedNodeException
import org.opensearch.action.support.nodes.BaseNodesResponse
import org.opensearch.cluster.ClusterName
import org.opensearch.common.Strings
import org.opensearch.core.common.io.stream.StreamInput
import org.opensearch.core.common.io.stream.StreamOutput
import org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS
Expand Down Expand Up @@ -117,7 +116,7 @@ class FollowerStatsResponse : BaseNodesResponse<FollowerNodeStatsResponse?>, ToX
override fun toString(): String {
val builder: XContentBuilder = XContentFactory.jsonBuilder().prettyPrint()
toXContent(builder, EMPTY_PARAMS)
return Strings.toString(builder)
return builder.toString()
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.apache.logging.log4j.LogManager
import org.opensearch.action.FailedNodeException
import org.opensearch.action.support.nodes.BaseNodesResponse
import org.opensearch.cluster.ClusterName
import org.opensearch.common.Strings
import org.opensearch.core.common.io.stream.StreamInput
import org.opensearch.core.common.io.stream.StreamOutput
import org.opensearch.core.xcontent.ToXContent.EMPTY_PARAMS
Expand Down Expand Up @@ -76,7 +75,7 @@ class LeaderStatsResponse : BaseNodesResponse<LeaderNodeStatsResponse?>, ToXCont
override fun toString(): String {
val builder: XContentBuilder = XContentFactory.jsonBuilder().prettyPrint()
toXContent(builder, EMPTY_PARAMS)
return Strings.toString(builder)
return builder.toString()
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package org.opensearch.replication.task.index

import org.opensearch.Version
import org.opensearch.core.ParseField
import org.opensearch.common.Strings
import org.opensearch.core.common.Strings
import org.opensearch.core.common.io.stream.StreamInput
import org.opensearch.core.common.io.stream.StreamOutput
import org.opensearch.core.xcontent.ObjectParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package org.opensearch.replication.task.shard

import org.opensearch.Version
import org.opensearch.core.ParseField
import org.opensearch.common.Strings
import org.opensearch.core.common.Strings
import org.opensearch.core.common.io.stream.StreamInput
import org.opensearch.core.common.io.stream.StreamOutput
import org.opensearch.core.xcontent.ObjectParser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.opensearch.Version
import org.opensearch.cluster.ClusterState
import org.opensearch.cluster.metadata.IndexMetadata
import org.opensearch.cluster.metadata.MetadataCreateIndexService
import org.opensearch.common.Strings
import org.opensearch.core.common.Strings
import org.opensearch.common.ValidationException
import org.opensearch.common.settings.Settings
import org.opensearch.env.Environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import org.opensearch.client.ResponseException
import org.opensearch.client.RestClient
import org.opensearch.client.RestClientBuilder
import org.opensearch.client.RestHighLevelClient
import org.opensearch.common.Strings
import org.opensearch.common.io.PathUtils
import org.opensearch.common.settings.Settings
import org.opensearch.common.unit.TimeValue
Expand Down Expand Up @@ -419,7 +418,7 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() {
clearCommand.endObject()
if (mustClear) {
val request = Request("PUT", "/_cluster/settings")
request.setJsonEntity(Strings.toString(clearCommand))
request.setJsonEntity(clearCommand.toString())
testCluster.lowLevelClient.performRequest(request)
}
}
Expand Down