void (@NotNull PsiClass aClass) { super.visitClass(aClass); if (!aClass.isEnum()) { checkTopLevelSemicolons(aClass); } else { boolean semicolonSeen = false; for (PsiElement sibling = aClass.getFirstChild(); sibling != null; sibling = PsiTreeUtil.skipWhitespacesAndCommentsForward(sibling)) { if (sibling instanceof PsiErrorElement) return; if (PsiUtil.isJavaToken(sibling, JavaTokenType.SEMICOLON)) { if (semicolonSeen) { registerError(sibling); } else if (!ignoreAfterEnumConstants) { final PsiElement element = PsiTreeUtil.skipWhitespacesAndCommentsForward(sibling); if (PsiUtil.isJavaToken(element, JavaTokenType.RBRACE)) { registerError(sibling); } } semicolonSeen = true; } } } }