You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Hitoshi Mitake (JIRA)" <ji...@apache.org> on 2015/05/21 08:36:01 UTC
[jira] [Created] (ZOOKEEPER-2194) Let DataNode.getChildren() return
an unmodifiable view of its children set
Hitoshi Mitake created ZOOKEEPER-2194:
-----------------------------------------
Summary: Let DataNode.getChildren() return an unmodifiable view of its children set
Key: ZOOKEEPER-2194
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2194
Project: ZooKeeper
Issue Type: Improvement
Reporter: Hitoshi Mitake
Priority: Trivial
Current DataNode.getChildren() directly returns a pointer of its private member, children. However, the member should be modified through addChild() and removeChild(). Callers of getChildren() shouldn't modify it directly.
For preventing the direct modification by the callers, this patch lets getChildren() return an unmodifiable view of its children set. If the callers try to modify directly, runtime exception will be risen.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)