GrAssignmentExpression (GrMethodCall call, String accessorName) { String name = GroovyPropertyUtils.getPropertyNameBySetterName(accessorName); if(name == null) return null; GrExpression value = call.getExpressionArguments()[0]; GrReferenceExpression refExpr = (GrReferenceExpression)call.getInvokedExpression(); final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(call.getProject()); final GrAssignmentExpression assignment = (GrAssignmentExpression)factory.createStatementFromText("yyy = xxx", call); GrReferenceExpression lvalueRef = (GrReferenceExpression)assignment.getLValue(); lvalueRef.setQualifier(refExpr.getQualifier()); lvalueRef.handleElementRename(name); assignment.getRValue().replaceWithExpression(value, true); return assignment; }