@Override
    public void visitMethod(@NotNull PsiMethod method) {
      super.visitMethod(method);
      if (!method.hasModifierProperty(PsiModifier.PRIVATE) || method.isConstructor()) {
        return;
      }
      if (onlyReportStaticMethods && !method.hasModifierProperty(PsiModifier.STATIC)) {
        return;
      }
      if (method.getNameIdentifier() == null) {
        return;
      }
      if (DeclarationSearchUtils.isTooExpensiveToSearch(method, false)) {
        registerPossibleProblem(method.getNameIdentifier());
        return;
      }
      final MethodReferenceFinder processor = new MethodReferenceFinder(method);
      final PsiClass innerClass = processor.getOnlyAccessInnerClass();
      if (innerClass == null) {
        return;
      }
      if (method.hasModifierProperty(PsiModifier.STATIC) && !PsiUtil.isAvailable(JavaFeature.INNER_STATICS, method)) {
        final PsiElement parent = innerClass.getParent();
        if (parent instanceof PsiClass && !innerClass.hasModifierProperty(PsiModifier.STATIC) || PsiUtil.isLocalClass(innerClass)) {
          return;
        }
      }
      if (ignoreMethodsAccessedFromAnonymousClass && PsiUtil.isLocalOrAnonymousClass(innerClass)) {
        return;
      }
      registerMethodError(method, innerClass);
    }
@Override
    public void visitMethod(@NotNull PsiMethod method)