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

    https://github.com/apache/zookeeper/pull/495#discussion_r177343134
  
    --- Diff: 
src/java/main/org/apache/zookeeper/server/ReferenceCountedACLCache.java ---
    @@ -109,16 +109,18 @@ public synchronized void deserialize(InputArchive ia) 
throws IOException {
                 }
                 List<ACL> aclList = new ArrayList<ACL>();
                 Index j = ia.startVector("acls");
    -            while (!j.done()) {
    -                ACL acl = new ACL();
    -                acl.deserialize(ia, "acl");
    -                aclList.add(acl);
    -                j.incr();
    +            if (j != null) {
    +                while (!j.done()) {
    +                    ACL acl = new ACL();
    +                    acl.deserialize(ia, "acl");
    +                    aclList.add(acl);
    +                    j.incr();
    +                }
    +                longKeyMap.put(val, aclList);
    --- End diff --
    
    +1 
    Only the inner while-loop uses the `j` variable, so nothing else should be 
inside the check.


---

Reply via email to