void (GrExpression initializer) { if (getParent() instanceof GrVariableDeclaration && ((GrVariableDeclaration)getParent()).isTuple()) { throw new UnsupportedOperationException("don't invoke 'setInitializer()' for tuple declaration"); } GrExpression oldInitializer = getInitializerGroovy(); if (initializer == null) { if (oldInitializer != null) { oldInitializer.delete(); PsiElement assign = findChildByType(GroovyTokenTypes.mASSIGN); if (assign != null) { assign.delete(); } } return; } if (oldInitializer != null) { oldInitializer.replaceWithExpression(initializer, true); } else { getNode().addLeaf(TokenType.WHITE_SPACE, " ", null); getNode().addLeaf(GroovyTokenTypes.mASSIGN, "=", null); addAfter(initializer, getLastChild()); } }