Github user eribeiro commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/102#discussion_r87466839
  
    --- Diff: src/java/main/org/apache/zookeeper/server/DataTree.java ---
    @@ -1293,13 +1293,12 @@ public synchronized WatchesSummary 
getWatchesSummary() {
          * @param pwriter the output to write to
          */
         public void dumpEphemerals(PrintWriter pwriter) {
    -        Set<Long> keys = ephemerals.keySet();
             pwriter.println("Sessions with Ephemerals ("
    -                + keys.size() + "):");
    -        for (long k : keys) {
    -            pwriter.print("0x" + Long.toHexString(k));
    +                + ephemerals.keySet().size() + "):");
    +        for (Entry<Long, HashSet<String>> entry : ephemerals.entrySet()) {
    +            pwriter.print("0x" + Long.toHexString(entry.getKey()));
                 pwriter.println(":");
    -            HashSet<String> tmp = ephemerals.get(k);
    +            HashSet<String> tmp = entry.getValue();
    --- End diff --
    
    Ya @lvfangmin, one of my favourite books on Java, and was the reference to 
my comment above. Thanks pointing out. :smiley:
    
    Agree with @hanm, better to create a separate issue for dealing with this 
legacy technical debt. :+1: 


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to