void (@NotNull PsiReferenceExpression ref) { super.visitReferenceExpression(ref); PsiElement element = ref.resolve(); if (element instanceof PsiModifierListOwner owner && !owner.hasModifierProperty(PsiModifier.STATIC) && !(owner instanceof PsiClass cls && ClassUtil.isTopLevelClass(cls))) { canBeStatic = false; stopWalking(); } }