void (GrCodeBlock newBlock) { ASTNode newNode = newBlock.getNode().copyElement(); final GrOpenBlock oldBlock = getBlock(); if (oldBlock == null) { getNode().addChild(newNode); return; } getNode().replaceChild(oldBlock.getNode(), newNode); }