src/share/classes/com/sun/jndi/dns/NameNode.java

Print this page

        

*** 50,60 **** class NameNode { private String label; // name of this node relative to its // parent, or null for root of a tree ! private Hashtable children = null; // child nodes private boolean isZoneCut = false; // true if this node is a zone cut private int depth = 0; // depth in tree (0 for root) NameNode(String label) { this.label = label; --- 50,60 ---- class NameNode { private String label; // name of this node relative to its // parent, or null for root of a tree ! private Hashtable<String,NameNode> children = null; // child nodes private boolean isZoneCut = false; // true if this node is a zone cut private int depth = 0; // depth in tree (0 for root) NameNode(String label) { this.label = label;
*** 95,116 **** /* * Returns the children of this node, or null if there are none. * The caller must not modify the Hashtable returned. */ ! Hashtable getChildren() { return children; } /* * Returns the child node given the hash key (the down-cased label) * for its name relative to this node, or null if there is no such * child. */ NameNode get(String key) { return (children != null) ! ? (NameNode) children.get(key) : null; } /* * Returns the node at the end of a path, or null if the --- 95,116 ---- /* * Returns the children of this node, or null if there are none. * The caller must not modify the Hashtable returned. */ ! Hashtable<String,NameNode> getChildren() { return children; } /* * Returns the child node given the hash key (the down-cased label) * for its name relative to this node, or null if there is no such * child. */ NameNode get(String key) { return (children != null) ! ? children.get(key) : null; } /* * Returns the node at the end of a path, or null if the
*** 138,150 **** String label = name.get(i); String key = name.getKey(i); NameNode child = null; if (node.children == null) { ! node.children = new Hashtable(); } else { ! child = (NameNode) node.children.get(key); } if (child == null) { child = newNameNode(label); child.depth = node.depth + 1; node.children.put(key, child); --- 138,150 ---- String label = name.get(i); String key = name.getKey(i); NameNode child = null; if (node.children == null) { ! node.children = new Hashtable<>(); } else { ! child = node.children.get(key); } if (child == null) { child = newNameNode(label); child.depth = node.depth + 1; node.children.put(key, child);