void (@NotNull PsiClass aClass) { // no call to super, so that it doesn't drill down to inner classes final PsiElement parent = aClass.getParent(); if (!(parent instanceof PsiJavaFile file)) { return; } final String className = aClass.getName(); if (className == null) { return; } final String fileName = file.getName(); final int prefixIndex = fileName.indexOf('.'); if (prefixIndex < 0) { return; } final String filenameWithoutPrefix = fileName.substring(0, prefixIndex); if (className.equals(filenameWithoutPrefix)) { return; } registerClassError(aClass, file); }