Mercurial > hg > truffle
changeset 9255:cdf10fb20022
Remove Node.replaceChild method from the public API. Node.replace remains as the only method in the API to modify the AST.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 23 Apr 2013 15:02:16 +0200 |
parents | 4497235516df |
children | 9640bb930327 |
files | graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/Node.java |
diffstat | 1 files changed, 6 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- 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 extends Node> 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 extends Node> T replaceChild(T oldChild, T newChild) { + NodeUtil.replaceChild(this, oldChild, newChild); + adoptChild(newChild); + return newChild; + } + /** * Replaces this node with another node. *