You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2018/03/01 20:01:46 UTC
[ambari] branch branch-feature-AMBARI-14714 updated: AMBARI-22883.
Count of each OS type is always 1 (#516)
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch branch-feature-AMBARI-14714
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-feature-AMBARI-14714 by this push:
new 543054f AMBARI-22883. Count of each OS type is always 1 (#516)
543054f is described below
commit 543054f8fb21ddfbc02b7b23813fa70a5cfc367a
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Thu Mar 1 21:01:43 2018 +0100
AMBARI-22883. Count of each OS type is always 1 (#516)
---
.../org/apache/ambari/server/api/query/render/HostSummaryRenderer.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/HostSummaryRenderer.java b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/HostSummaryRenderer.java
index 3d6b843..45e73ad 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/HostSummaryRenderer.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/api/query/render/HostSummaryRenderer.java
@@ -83,7 +83,7 @@ public class HostSummaryRenderer extends DefaultRenderer {
Resource resource = node.getObject();
String osType = (String) resource.getPropertyValue(HostResourceProvider.HOST_OS_TYPE_PROPERTY_ID);
if (StringUtils.isNotBlank(osType)) {
- osTypeCount.put(osType, osTypeCount.getOrDefault(osTypeCount, 0) + 1);
+ osTypeCount.merge(osType, 1, Integer::sum);
}
}
}
--
To stop receiving notification emails like this one, please contact
adoroszlai@apache.org.