private void checkForStaticFieldAccess(PsiExpression expression) {
      if (!(expression instanceof PsiReferenceExpression)) {
        return;
      }
      final PsiElement referent = ((PsiReference)expression).resolve();
      if (referent == null) {
        return;
      }
      if (!(referent instanceof PsiField fieldReferenced)) {
        return;
      }
      if (!fieldReferenced.hasModifierProperty(PsiModifier.STATIC)) {
        return;
      }
      if (isInStaticMember(expression)) {
        return;
      }
      registerError(expression);
    }
private void checkForStaticFieldAccess(PsiExpression expression)