@Override protected void visitBinaryOperation(BinaryOperation node) { if (node == toReplace) { result = replacement; return; } if (node.getLeft() == toReplace) { node.setLeft(replacement); } if (node.getRight() == toReplace) { node.setRight(replacement); } super.visitBinaryOperation(node); }
@Override protected void visitBinaryOperation(BinaryOperation node) { node.getLeft().accept(expressionVisitor); if (replaceWith != null) { node.setLeft(replaceWith); replaceWith = null; } node.getRight().accept(expressionVisitor); if (replaceWith != null) { node.setRight(replaceWith); replaceWith = null; } }
@Override protected void visitBinaryOperation(BinaryOperation node) { node.getLeft().accept(this); if (result != null) { node.setLeft(result); result = null; } node.getRight().accept(this); if (result != null) { node.setRight(result); result = null; } }
@Override protected void visitBinaryOperation(BinaryOperation node) { resultValue = null; node.getLeft().accept(this); if (resultValue != null) { node.setLeft(resultValue); resultValue = null; } node.getRight().accept(this); if (resultValue != null) { node.setRight(resultValue); resultValue = null; } }
@Override protected void visitBinaryOperation(BinaryOperation node) { resultValue = null; node.getLeft().accept(this); if (resultValue != null) { node.setLeft(resultValue); resultValue = null; } node.getRight().accept(this); if (resultValue != null) { node.setRight(resultValue); resultValue = null; } }
/** * Visits a BinaryOperation instance * @param binaryOperation The BinaryOperation */ private void visitBinaryOperation(BinaryOperation binaryOperation) { binaryOperation.getLeft().accept(this); if (replace) { binaryOperation.setLeft(toReplace); replace = false; } binaryOperation.getRight().accept(this); if (replace) { binaryOperation.setRight(toReplace); replace = false; } }