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/05/09 09:12:13 UTC

[ambari] branch branch-feature-AMBARI-14714 updated: AMBARI-23746. Fix typo in map lookup (#1208)

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 d5b1856  AMBARI-23746. Fix typo in map lookup (#1208)
d5b1856 is described below

commit d5b185680636059fbf136ef5858a06d6561a47a8
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Wed May 9 11:12:06 2018 +0200

    AMBARI-23746. Fix typo in map lookup (#1208)
---
 .../java/org/apache/ambari/server/state/cluster/ClusterImpl.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index d35bd9c..8af5934 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -1193,9 +1193,8 @@ public class ClusterImpl implements Cluster {
   @Override
   public List<Service> getServicesByServiceGroup(String serviceGroupName) {
     List<Service> servicesByServiceGroup = new ArrayList<>();
-    for(Entry<Long, Service> serviceEntry: servicesById.entrySet()){
-      Service s = servicesById.get(serviceEntry.getValue());
-      if (s.getServiceGroupName().equals(serviceGroupName)){
+    for (Service s : servicesById.values()) {
+      if (s.getServiceGroupName().equals(serviceGroupName)) {
         servicesByServiceGroup.add(s);
       }
     }

-- 
To stop receiving notification emails like this one, please contact
adoroszlai@apache.org.