void (@NotNull PsiReferenceExpression expression) { PsiElement ref = expression.resolve(); if (ref instanceof PsiField && containingClassFields.contains(ref) && hasSameStaticModifier(field, (PsiField)ref)) { referencedElements.add((PsiField)ref); } else if (ref instanceof PsiMethod && myCurrentMethodLookupDepth < MAX_METHOD_LOOKUP_DEPTH) { myCurrentMethodLookupDepth++; visitMethod((PsiMethod)ref); myCurrentMethodLookupDepth--; } super.visitReferenceExpression(expression); }