PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitIfStatement(@NotNull PsiIfStatement statement) { if (statement.getElseBranch() != null) { PsiKeyword keyw = (PsiKeyword)statement.getChildren()[0]; holder.registerProblem(keyw, "Dododo", new StupidQuickFixWhichDoesntCheckItsOwnApplicability()); } } }; }