zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eribeiro <...@git.apache.org>
Subject [GitHub] zookeeper pull request #102: ZOOKEEPER-2628: Fix findbug warnings.
Date Tue, 08 Nov 2016 17:25:28 GMT
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<Long> 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<Long, Long> 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.
---

Mime
View raw message