Skip to content

Commit 14c4a49

Browse files
committed
Remove dandling spaces wherever found.
This PR addresses #117067 , a report about unexpected spaces breaking message parsers built by customers. I used the regex `(\. \")(?![A-Z(a-z_0-9-;<%\/\.+ \t\n]+)` to detect such instances and clean up. In one case, a minor code improvement helps add optional spaces as necessary for a multi-sentence error message.
1 parent c2fdc06 commit 14c4a49

File tree

17 files changed

+35
-24
lines changed

17 files changed

+35
-24
lines changed

libs/x-content/src/main/java/org/elasticsearch/xcontent/ObjectParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ private void throwExpectedStartObject(XContentParser parser, XContentParser.Toke
334334
private static void throwMissingRequiredFields(List<String[]> requiredFields) {
335335
final StringBuilder message = new StringBuilder();
336336
for (String[] fields : requiredFields) {
337-
message.append("Required one of fields ").append(Arrays.toString(fields)).append(", but none were specified. ");
337+
message.append("Required one of fields ").append(Arrays.toString(fields)).append(", but none were specified.");
338338
}
339339
throw new IllegalArgumentException(message.toString());
340340
}

server/src/main/java/org/elasticsearch/cluster/routing/allocation/shards/ShardsAvailabilityHealthIndicatorService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static void updateShardAllocationStatus(
309309
NAME,
310310
"increase_shard_limit_index_setting",
311311
"Elasticsearch isn't allowed to allocate some shards from these indices to any data nodes because each node has reached the index "
312-
+ "shard limit. ",
312+
+ "shard limit.",
313313
"Increase the values for the ["
314314
+ INDEX_TOTAL_SHARDS_PER_NODE_SETTING.getKey()
315315
+ "] index setting on each index or add more nodes to the target tiers.",
@@ -326,7 +326,7 @@ static void updateShardAllocationStatus(
326326
"increase_shard_limit_index_setting:tier:" + tier,
327327
"Elasticsearch isn't allowed to allocate some shards from these indices because each node in the ["
328328
+ tier
329-
+ "] tier has reached the index shard limit. ",
329+
+ "] tier has reached the index shard limit.",
330330
"Increase the values for the ["
331331
+ INDEX_TOTAL_SHARDS_PER_NODE_SETTING.getKey()
332332
+ "] index setting on each index or add more nodes to the target tiers.",
@@ -357,7 +357,7 @@ static void updateShardAllocationStatus(
357357
"increase_shard_limit_cluster_setting:tier:" + tier,
358358
"Elasticsearch isn't allowed to allocate some shards from these indices because each node in the ["
359359
+ tier
360-
+ "] tier has reached the cluster shard limit. ",
360+
+ "] tier has reached the cluster shard limit.",
361361
"Increase the values for the ["
362362
+ CLUSTER_TOTAL_SHARDS_PER_NODE_SETTING.getKey()
363363
+ "] cluster setting or add more nodes to the target tiers.",
@@ -405,7 +405,7 @@ static void updateShardAllocationStatus(
405405
NAME,
406406
"migrate_data_tiers_include_data",
407407
"Elasticsearch isn't allowed to allocate some shards from these indices to any nodes in the desired data tiers because the "
408-
+ "indices are configured with allocation filter rules that are incompatible with the nodes in this tier. ",
408+
+ "indices are configured with allocation filter rules that are incompatible with the nodes in this tier.",
409409
"Remove ["
410410
+ INDEX_ROUTING_INCLUDE_GROUP_PREFIX
411411
+ ".data] from the index settings or try migrating to data tiers by first stopping ILM [POST /_ilm/stop] and then using "

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/CommandLineHttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public void checkClusterHealthWithRetriesWaitingForCluster(String username, Secu
277277
checkClusterHealthWithRetriesWaitingForCluster(username, password, retries);
278278
return;
279279
} else {
280-
throw new IllegalStateException("Failed to determine the health of the cluster. ", e);
280+
throw new IllegalStateException("Failed to determine the health of the cluster.", e);
281281
}
282282
}
283283
final int responseStatus = response.getHttpStatus();

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/store/ReservedRolesStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
496496
+ "This role grants monitor_ml cluster privileges, read access to the .ml-notifications and .ml-anomalies* indices "
497497
+ "(which store machine learning results), and write access to .ml-annotations* indices. "
498498
+ "Machine learning users also need index privileges for source and destination indices "
499-
+ "and roles that grant access to Kibana. "
499+
+ "and roles that grant access to Kibana."
500500
)
501501
),
502502
entry(

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static DeprecationIssue checkMultipleDataPaths(
211211
"Specifying multiple data paths is deprecated",
212212
"https://ela.st/es-deprecation-7-multiple-paths",
213213
"The [path.data] setting contains a list of paths. Specify a single path as a string. Use RAID or other system level "
214-
+ "features to utilize multiple disks. If multiple data paths are configured, the node will fail to start in 8.0. ",
214+
+ "features to utilize multiple disks. If multiple data paths are configured, the node will fail to start in 8.0.",
215215
false,
216216
null
217217
);
@@ -231,7 +231,7 @@ static DeprecationIssue checkDataPathsList(
231231
"Multiple data paths are not supported",
232232
"https://ela.st/es-deprecation-7-multiple-paths",
233233
"The [path.data] setting contains a list of paths. Specify a single path as a string. Use RAID or other system level "
234-
+ "features to utilize multiple disks. If multiple data paths are configured, the node will fail to start in 8.0. ",
234+
+ "features to utilize multiple disks. If multiple data paths are configured, the node will fail to start in 8.0.",
235235
false,
236236
null
237237
);

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/fulltext/QueryString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public QueryString(
145145
name = "allow_wildcard",
146146
type = "boolean",
147147
valueHint = { "false", "true" },
148-
description = "If true, the query attempts to analyze wildcard terms in the query string. Defaults to false. "
148+
description = "If true, the query attempts to analyze wildcard terms in the query string. Defaults to false."
149149
),
150150
@MapParam.MapParamEntry(
151151
name = "analyzer",

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/BaseTransportInferenceAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ private ElasticsearchStatusException unsupportedStreamingTaskException(Request r
423423
}
424424

425425
private static ElasticsearchStatusException unknownServiceException(String service, String inferenceId) {
426-
return new ElasticsearchStatusException("Unknown service [{}] for model [{}]. ", RestStatus.BAD_REQUEST, service, inferenceId);
426+
return new ElasticsearchStatusException("Unknown service [{}] for model [{}]", RestStatus.BAD_REQUEST, service, inferenceId);
427427
}
428428

429429
private static ElasticsearchStatusException requestModelTaskTypeMismatchException(TaskType requested, TaskType expected) {

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/action/TransportGetInferenceModelAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private void parseModels(List<UnparsedModel> unparsedModels, ActionListener<GetI
174174

175175
private ElasticsearchStatusException serviceNotFoundException(String service, String inferenceId) {
176176
throw new ElasticsearchStatusException(
177-
"Unknown service [{}] for inference endpoint [{}]. ",
177+
"Unknown service [{}] for inference endpoint [{}]",
178178
RestStatus.INTERNAL_SERVER_ERROR,
179179
service,
180180
inferenceId

x-pack/plugin/security/cli/src/main/java/org/elasticsearch/xpack/security/cli/HttpCertificateCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ private static boolean askCertSigningRequest(Terminal terminal) {
817817

818818
terminal.println("A CSR is used when you want your certificate to be created by an existing");
819819
terminal.println("Certificate Authority (CA) that you do not control (that is, you don't have");
820-
terminal.println("access to the keys for that CA). ");
820+
terminal.println("access to the keys for that CA).");
821821
terminal.println("");
822822
terminal.println("If you are in a corporate environment with a central security team, then you");
823823
terminal.println("may have an existing Corporate CA that can generate your certificate for you.");

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/TokenService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ private void innerRefresh(
13481348
);
13491349
} else {
13501350
logger.info(
1351-
"failed to update the original token document [{}] after all retries, the update result was [{}]. ",
1351+
"failed to update the original token document [{}] after all retries, the update result was [{}].",
13521352
tokenDoc.id(),
13531353
updateResponse.getResult()
13541354
);

0 commit comments

Comments
 (0)