@Override
  public void visitReferenceExpression(@NotNull PsiReferenceExpression expression) {
    super.visitReferenceExpression(expression);
    final PsiElement qualifier = expression.getQualifierExpression();
    if (qualifier == null || qualifier instanceof PsiQualifiedExpression) {
      final PsiElement element = expression.resolve();
      if (element != null) {
        if ((element instanceof PsiLocalVariable || element instanceof PsiParameter) && 
            PsiTreeUtil.isAncestor(PsiUtil.getVariableCodeBlock((PsiVariable)element, null), m_method, true)) {
          m_referencesStaticallyAccessible = false;
          return;
        }
        if (!(element instanceof PsiMember member)) return;
        if (member == m_method || member.hasModifierProperty(PsiModifier.STATIC) ||
            member instanceof PsiClass && member.getContainingClass() == null) {
          return;
        }
        PsiExpression effectiveQualifier = ExpressionUtils.getEffectiveQualifier(expression);
        if (effectiveQualifier != null) {
          PsiClass aClass = PsiUtil.resolveClassInClassTypeOnly(effectiveQualifier.getType());
          if (aClass != null && PsiTreeUtil.isAncestor(m_method, aClass, false)) return;
        }
      }
      m_referencesStaticallyAccessible = false;
    }
  }
@Override
  public void visitReferenceExpression(@NotNull PsiReferenceExpression expression)