PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!(holder.getFile() instanceof PsiClassOwner)) { return PsiElementVisitor.EMPTY_VISITOR; } return new PsiElementVisitor() { @Override public void visitElement(@NotNull PsiElement element) { if (element instanceof GrTypeDefinition) { PsiClass aClass = (PsiClass)element; final String name = aClass.getName(); if (name == null) return; checkName(aClass, name, holder); } } }; }