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

Removed unneeded calls of String.format. #16357

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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 @@ -145,7 +145,7 @@ private String writeMetadataManifest(String clusterUUID, ClusterMetadataManifest
CountDownLatch latch = new CountDownLatch(1);

LatchedActionListener completionListener = new LatchedActionListener<>(ActionListener.wrap(resp -> {
logger.trace(String.format(Locale.ROOT, "Manifest file uploaded successfully."));
logger.trace("Manifest file uploaded successfully.");
}, ex -> { exceptionReference.set(ex); }), latch);

RemoteClusterMetadataManifest remoteClusterMetadataManifest = new RemoteClusterMetadataManifest(
Expand All @@ -159,13 +159,13 @@ private String writeMetadataManifest(String clusterUUID, ClusterMetadataManifest
try {
if (latch.await(getMetadataManifestUploadTimeout().millis(), TimeUnit.MILLISECONDS) == false) {
RemoteStateTransferException ex = new RemoteStateTransferException(
String.format(Locale.ROOT, "Timed out waiting for transfer of manifest file to complete")
"Timed out waiting for transfer of manifest file to complete"
);
throw ex;
}
} catch (InterruptedException ex) {
RemoteStateTransferException exception = new RemoteStateTransferException(
String.format(Locale.ROOT, "Timed out waiting for transfer of manifest file to complete - %s"),
"Timed out waiting for transfer of manifest file to complete",
ex
);
Thread.currentThread().interrupt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public static void validate(
) {
if (!isCompositeFieldPresent && mapperService.isCompositeIndexPresent()) {
throw new IllegalArgumentException(
String.format(
Locale.ROOT,
"Composite fields must be specified during index creation, addition of new composite fields during update is not supported"
)
"Composite fields must be specified during index creation, addition of new composite fields during update is not supported"
);
}
StarTreeValidator.validate(mapperService, compositeIndexSettings, indexSettings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public void testIndicesRoutingDiffWhenIndexDeletedAndAdded() {
public void testGetAsyncIndexRoutingReadAction() throws Exception {
String indexName = randomAlphaOfLength(randomIntBetween(1, 50));
ClusterState clusterState = createClusterState(indexName);
String uploadedFileName = String.format(Locale.ROOT, "index-routing/" + indexName);
String uploadedFileName = "index-routing/" + indexName;
when(blobContainer.readBlob(indexName)).thenReturn(
INDEX_ROUTING_TABLE_FORMAT.serialize(
clusterState.getRoutingTable().getIndicesRouting().get(indexName),
Expand Down Expand Up @@ -598,7 +598,7 @@ public void testGetAsyncIndexRoutingTableDiffReadAction() throws Exception {

RoutingTableIncrementalDiff diff = new RoutingTableIncrementalDiff(previousState.getRoutingTable(), currentState.getRoutingTable());

String uploadedFileName = String.format(Locale.ROOT, "routing-table-diff/" + indexName);
String uploadedFileName = "routing-table-diff/" + indexName;
when(blobContainer.readBlob(indexName)).thenReturn(
REMOTE_ROUTING_TABLE_DIFF_FORMAT.serialize(diff, uploadedFileName, compressor).streamInput()
);
Expand Down
Loading