private boolean ensureNonShadowedVariable(@NotNull PsiVariable element) {
        if (element instanceof PsiField) {
          PsiClass parentClass = PsiTreeUtil.getParentOfType(PsiReferenceExpressionImpl.this, PsiClass.class);
          if (!PsiResolveHelper.getInstance(getProject())
            .isAccessible((PsiField)element, PsiReferenceExpressionImpl.this, parentClass)) {
            return true;
          }
        }
        boolean added = myVarNames.add(element.getName());
        return !PsiUtil.isJvmLocalVariable(element) || added;
      }
private boolean ensureNonShadowedVariable(@NotNull PsiVariable element)