Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
Currently the validateACL() method in Zookeeper.java looks like this:
if (acl == null || acl.isEmpty() || acl.contains(null)) { throw new KeeperException.InvalidACLException(); }
However the contains() method for an ImmutableCollection validates that the argument is non-null: (Note, contains(){} calls {{indexOf(){}}})
@Override public int indexOf(Object o) { Objects.requireNonNull(o); for (int i = 0, s = size(); i < s; i++) { if (o.equals(get(i))) { return i; } } return -1; }
Therefore if you try to pass an immutable collection for ACLs, you will get a null-pointer exception.
Attachments
Issue Links
- blocks
-
ZOOKEEPER-1362 ZooDefs.Ids ACL lists not immutable
- Open