Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-2194

Let DataNode.getChildren() return an unmodifiable view of its children set

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.4.6, 3.5.0
    • 3.4.7, 3.5.1, 3.6.0
    • server
    • None
    • Patch

    Description

      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.

      Attachments

        1. ZOOKEEPER-2194.patch
          0.9 kB
          Hitoshi Mitake
        2. ZOOKEEPER-2194-v2.patch
          0.9 kB
          Hitoshi Mitake

        Activity

          People

            mitake Hitoshi Mitake
            mitake Hitoshi Mitake
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: