boolean (PsiMethod psiMethod, @NotNull Editor editor, @Nullable SmartPsiElementPointer<PsiStatement> afterStatementPtr) { if (afterStatementPtr != null) { PsiStatement[] statements = psiMethod.getBody().getStatements(); int nStatements = statements.length; assertTrue(nStatements >= 1 && statements[nStatements - 1] == afterStatementPtr.dereference()); if (nStatements >= 2) { PsiStatement lastConverted = statements[nStatements - 2]; if (lastConverted instanceof PsiThrowStatement) return false; } } List<HighlightInfo> infos = RehighlightAllEditors.highlightEditor(editor, getProject()); return infos.stream().anyMatch(i -> i.getSeverity() == HighlightSeverity.ERROR); }