PsiElementVisitor (@NotNull final ProblemsHolder holder, final boolean isOnTheFly) { return new JavaElementVisitor() { @Override public void visitReferenceExpression(final @NotNull PsiReferenceExpression expression) { visitExpression(expression); } @Override public void visitLiteralExpression(@NotNull PsiLiteralExpression expression) { checkStringLiteralExpression(expression, holder, isOnTheFly); } }; }