# HG changeset patch # User Thomas Wuerthinger # Date 1366722136 -7200 # Node ID cdf10fb2002290b4aaa80a4724b9b010774fc294 # Parent 4497235516df0892e3c34fd9a73bb846af15b144 Remove Node.replaceChild method from the public API. Node.replace remains as the only method in the API to modify the AST. diff -r 4497235516df -r cdf10fb20022 graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java --- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Tue Apr 23 14:59:24 2013 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java Tue Apr 23 15:02:16 2013 +0200 @@ -135,19 +135,6 @@ } /** - * Replaces one child of this node with another node. - * - * @param oldChild the old child - * @param newChild the new child that should replace the old child - * @return the new child - */ - public final T replaceChild(T oldChild, T newChild) { - NodeUtil.replaceChild(this, oldChild, newChild); - adoptChild(newChild); - return newChild; - } - - /** * Replaces this node with another node. * * @param newNode the new node that is the replacement @@ -160,6 +147,12 @@ return (T) this.getParent().replaceChild(this, newNode); } + private T replaceChild(T oldChild, T newChild) { + NodeUtil.replaceChild(this, oldChild, newChild); + adoptChild(newChild); + return newChild; + } + /** * Replaces this node with another node. *