public static boolean canBePendingReference(@NotNull PsiJavaCodeReferenceElement ref) {
    if (ref instanceof PsiReferenceExpression) {
      PsiExpression qualifier = ((PsiReferenceExpression)ref).getQualifierExpression();
      if (qualifier == null) {
        PsiClass psiClass = PsiUtil.getContainingClass(ref);
        while (psiClass != null) {
          if (!isHierarchyResolved(psiClass)) return true;
          psiClass = PsiUtil.getContainingClass(psiClass);
        }
        return !getPotentialImports(ref).isEmpty();
      }
      if (qualifier instanceof PsiReferenceExpression) {
        PsiElement qualifierTarget = ((PsiReferenceExpression)qualifier).resolve();
        if (qualifierTarget == null && canBePendingReference((PsiReferenceExpression)qualifier)) {
          return true;
        }
        if (qualifierTarget instanceof PsiClass && isHierarchyResolved((PsiClass)qualifierTarget)) {
          return false;
        }
      }
      PsiType qualifierType = qualifier.getType();
      if (isUnresolvedClassType(qualifierType) ||
          (qualifierType == null && mayHaveUnknownTypeDueToPendingReference(qualifier)) ||
          (PsiTypes.nullType().equals(qualifierType) && mayHaveNullTypeDueToPendingReference(qualifier))) {
        return true;
      }
    }
    else {
      return true;
    }
    return false;
  }
public static boolean canBePendingReference(@NotNull PsiJavaCodeReferenceElement ref)