@Override
  public void resolveEntryPoints(@NotNull final RefManager manager) {
    if (!myResolved) {
      myResolved = true;
      cleanup();
      validateEntryPoints();

      ApplicationManager.getApplication()
          .runReadAction(
              () -> {
                for (SmartRefElementPointer entryPoint : myPersistentEntryPoints.values()) {
                  if (entryPoint.resolve(manager)) {
                    RefEntity refElement = entryPoint.getRefElement();
                    ((RefElementImpl) refElement).setEntry(true);
                    ((RefElementImpl) refElement).setPermanentEntry(entryPoint.isPersistent());
                  }
                }

                for (ClassPattern pattern : myPatterns) {
                  final RefEntity refClass =
                      manager.getReference(RefJavaManager.CLASS, pattern.pattern);
                  if (refClass != null) {
                    for (RefMethod constructor : ((RefClass) refClass).getConstructors()) {
                      ((RefMethodImpl) constructor).setEntry(true);
                      ((RefMethodImpl) constructor).setPermanentEntry(true);
                    }
                  }
                }
              });
    }
  }
 @Nullable
 public static RefMethod methodFromExternalName(RefManager manager, String externalName) {
   return (RefMethod)
       manager.getReference(
           findPsiMethod(PsiManager.getInstance(manager.getProject()), externalName));
 }