void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiElement parent = element.getParent(); final PsiStatement statement; if (element instanceof PsiStatement) { statement = (PsiStatement)element; } else if (parent instanceof PsiStatement) { statement = (PsiStatement)parent; } else { return; } final PsiStatement statementWithoutBraces; if (statement instanceof PsiLoopStatement loopStatement) { statementWithoutBraces = loopStatement.getBody(); } else if (statement instanceof PsiIfStatement ifStatement) { statementWithoutBraces = (element == ifStatement.getElseElement()) ? ifStatement.getElseBranch() : ifStatement.getThenBranch(); } else { return; } if (statementWithoutBraces == null) { return; } BlockUtils.expandSingleStatementToBlockStatement(statementWithoutBraces); }