void (@NotNull PsiMethod method) { super.visitMethod(method); if (method.isConstructor()) { return; } if (method.getNameIdentifier() == null) { return; } if (!method.hasModifierProperty(PsiModifier.PUBLIC)) { return; } if (method.hasModifierProperty(PsiModifier.STATIC)) { return; } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null) { return; } if (containingClass.isInterface() || containingClass.isAnnotationType()) { return; } if (!containingClass.hasModifierProperty(PsiModifier.PUBLIC)) { return; } if (AnnotationUtil.isAnnotated(method, ignorableAnnotations, 0)) { return; } if (onlyWarnIfContainingClassImplementsAnInterface) { final PsiClass[] superClasses = containingClass.getSupers(); boolean implementsInterface = false; for (PsiClass superClass : superClasses) { if (superClass.isInterface() && !LibraryUtil.classIsInLibrary(superClass)) { implementsInterface = true; break; } } if (!implementsInterface) { return; } } if (exposedInInterface(method, new HashSet<>())) { return; } if (TestUtils.isJUnitTestMethod(method)) { return; } registerMethodError(method, method); }