@Override
  public PsiReference @NotNull [] getReferences() {
    PsiReference[] references = ReferenceProvidersRegistry.getReferencesFromProviders(this);
    if (references.length > 0) return references;

    return ReadAction.compute(() -> {

      final List<PsiReference> refs = new ArrayList<>();
      int idx = 0;
      int d;
      final String fileName = getName();
      while ((d = fileName.indexOf(".", idx)) > -1) {
        final PsiPackage aPackage = JavaPsiFacade.getInstance(getProject()).findPackage(fileName.substring(0, d));
        if (aPackage != null) {
          refs.add(new SPIFileName2PackageReference(this, aPackage));
        }
        idx = d + 1;
      }
      final PsiReference reference = getReference();
      PsiElement resolve = reference.resolve();
      while (resolve instanceof PsiClass) {
        PsiClass psiClass = (PsiClass)resolve;
        resolve = psiClass.getContainingClass();
        if (resolve != null) {
          final String jvmClassName = ClassUtil.getJVMClassName(psiClass);
          if (jvmClassName != null) {
            refs.add(new SPIFileName2PackageReference(this, resolve));
          }
        }
      }
      refs.add(reference);
      return refs.toArray(PsiReference.EMPTY_ARRAY);
    });
  }
@Override
  public PsiReference @NotNull [] getReferences()