You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "junkaixue (via GitHub)" <gi...@apache.org> on 2023/08/03 17:50:46 UTC
[GitHub] [helix] junkaixue commented on a diff in pull request #2583: Fix inconsistent maintenance "reason" key formatting
junkaixue commented on code in PR #2583:
URL: https://github.com/apache/helix/pull/2583#discussion_r1283532689
##########
helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/ClusterAccessor.java:
##########
@@ -321,8 +322,13 @@ public Response updateCluster(@PathParam("clusterId") String clusterId,
customFieldsMap =
OBJECT_MAPPER.readValue(content, new TypeReference<HashMap<String, String>>() {
});
- // content is given as a KV mapping. Nullify content
+ // content is given as a KV mapping. Nullify content unless (case-insensitive) reason key present in map
content = null;
+ for (Map.Entry<String, String> entry : customFieldsMap.entrySet()) {
+ if ("reason".equals(entry.getKey().toLowerCase(Locale.ENGLISH))) {
Review Comment:
I think Locale.ENGLISH is not needed, right? We are not checking semantics or not.
If the key does not match, it is not right then.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org