cryptoe commented on code in PR #13045:
URL: https://github.com/apache/druid/pull/13045#discussion_r964998814
##########
server/src/main/java/org/apache/druid/server/StatusResource.java:
##########
@@ -92,15 +93,15 @@ private Map<String, String> filterHiddenProperties(
Map<String, String> allProperties
)
{
- return Maps.filterEntries(
- allProperties,
- (entry) -> hiddenProperties
- .stream()
- .anyMatch(
- hiddenPropertyElement ->
-
!StringUtils.toLowerCase(entry.getKey()).contains(StringUtils.toLowerCase(hiddenPropertyElement))
- )
+ Map<String, String> propertyCopy = new HashMap<>(allProperties);
+ allProperties.keySet().forEach(
+ (key) -> {
+ if (hiddenProperties.stream().anyMatch((hiddenProperty) ->
StringUtils.toLowerCase(key).contains(StringUtils.toLowerCase(hiddenProperty))))
{
Review Comment:
nit: So if we have set of hiddenProps as =["pwd"] and in the allProperties
we have {"foopwd"->"secret1" , "pwd"->"secret", "foo"->"bar" } the output
would be {"foo"->"bar"} .
In that case, we should update a JavaDoc to reflect this
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]