private static void postprocessSwitch(@NotNull ModPsiUpdater updater,
                                            PsiExpression expr,
                                            CodeStyleManager codeStyleManager,
                                            PsiElement toReplace,
                                            PsiSwitchBlock switchBlock) {
        Document document = expr.getContainingFile().getFileDocument();
        switchBlock = (PsiSwitchBlock)codeStyleManager.reformat(switchBlock);
        PsiExpression selectorExpression = switchBlock.getExpression();
        if (selectorExpression != null) {
          selectorExpression.replace(expr);
        }

        switchBlock = (PsiSwitchBlock)toReplace.replace(switchBlock);

        PsiCodeBlock body = switchBlock.getBody();
        if (body != null) {
          body = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(body);
          if (body != null) {
            TextRange range = body.getStatements()[0].getTextRange();
            document.deleteString(range.getStartOffset(), range.getEndOffset());
            updater.select(TextRange.from(range.getStartOffset(), 0));
          }
        }
      }
private static void postprocessSwitch(@NotNull ModPsiUpdater updater,
                                            PsiExpression expr,
                                            CodeStyleManager codeStyleManager,
                                            PsiElement toReplace,
                                            PsiSwitchBlock switchBlock)