Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3301E200BBD for ; Tue, 8 Nov 2016 18:25:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 31A2F160B0C; Tue, 8 Nov 2016 17:25:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9DF12160B0A for ; Tue, 8 Nov 2016 18:25:29 +0100 (CET) Received: (qmail 47875 invoked by uid 500); 8 Nov 2016 17:25:28 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 47598 invoked by uid 99); 8 Nov 2016 17:25:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2016 17:25:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 09A61DFCF0; Tue, 8 Nov 2016 17:25:28 +0000 (UTC) From: eribeiro To: dev@zookeeper.apache.org Reply-To: dev@zookeeper.apache.org References: In-Reply-To: Subject: [GitHub] zookeeper pull request #102: ZOOKEEPER-2628: Fix findbug warnings. Content-Type: text/plain Message-Id: <20161108172528.09A61DFCF0@git1-us-west.apache.org> Date: Tue, 8 Nov 2016 17:25:28 +0000 (UTC) archived-at: Tue, 08 Nov 2016 17:25:30 -0000 Github user eribeiro commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/102#discussion_r87027302 --- Diff: src/java/main/org/apache/zookeeper/server/quorum/flexible/QuorumHierarchical.java --- @@ -344,9 +345,10 @@ public boolean containsQuorum(Set set){ * Check if all groups have majority */ int majGroupCounter = 0; - for(long gid : expansion.keySet()) { - LOG.debug("Group info: " + expansion.get(gid) + ", " + gid + ", " + groupWeight.get(gid)); - if(expansion.get(gid) > (groupWeight.get(gid) / 2) ) + for (Entry entry : expansion.entrySet()) { + Long gid = entry.getKey(); + LOG.debug("Group info: " + entry.getValue() + ", " + gid + ", " + groupWeight.get(gid)); + if(entry.getValue() > (groupWeight.get(gid) / 2) ) --- End diff -- nit: add space after the `if` and remove space before the last parenthesis. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---