@Override
  protected ClassMember @Nullable [] chooseOriginalMembers(PsiClass aClass, Project project) {
    if (aClass instanceof PsiAnonymousClass) {
      Messages.showMessageDialog(project,
                                 JavaBundle.message("error.attempt.to.generate.constructor.for.anonymous.class"),
                                 CommonBundle.getErrorTitle(),
                                 Messages.getErrorIcon());
      return null;
    }

    if (aClass instanceof PsiImplicitClass) {
      Messages.showMessageDialog(project,
                                 JavaBundle.message("error.attempt.to.generate.constructor.for.anonymous.class"),
                                 CommonBundle.getErrorTitle(),
                                 Messages.getErrorIcon());
      return null;
    }

    if (aClass.isRecord()) {
      PsiMethod constructor = JavaPsiRecordUtil.findCanonicalConstructor(aClass);
      if (constructor instanceof LightRecordCanonicalConstructor) {
        RecordConstructorChooserDialog dialog = new RecordConstructorChooserDialog(aClass);
        if (!dialog.showAndGet()) return null;
        ClassMember member = dialog.getClassMember();
        if (member != null) {
          return new ClassMember[]{member};
        }
      }
    }

    myCopyJavadoc = false;
    PsiMethod[] baseConstructors = DumbService.getInstance(project).computeWithAlternativeResolveEnabled(
      () -> {
        PsiClass baseClass = aClass.getSuperClass();
        if (baseClass != null) {
          List<PsiMethod> array = new ArrayList<>();
          for (PsiMethod method : baseClass.getConstructors()) {
            if (JavaPsiFacade.getInstance(method.getProject()).getResolveHelper().isAccessible(method, aClass, null)) {
              array.add(method);
            }
          }
          if (!array.isEmpty()) {
            if (array.size() == 1) {
              return new PsiMethod[]{array.get(0)};
            }
            else {
              final PsiSubstitutor substitutor = TypeConversionUtil.getSuperClassSubstitutor(baseClass, aClass, PsiSubstitutor.EMPTY);
              PsiMethodMember[] constructors =
                ContainerUtil.map2Array(array, PsiMethodMember.class, s -> new PsiMethodMember(s, substitutor));
              MemberChooser<PsiMethodMember> chooser = new MemberChooser<>(constructors, false, true, project);
              chooser.setTitle(JavaBundle.message("generate.constructor.super.constructor.chooser.title"));
              chooser.show();
              List<PsiMethodMember> elements = chooser.getSelectedElements();
              if (elements == null || elements.isEmpty()) return null;
              PsiMethod[] members = new PsiMethod[elements.size()];
              for (int i = 0; i < elements.size(); i++) {
                final PsiMethodMember member = elements.get(i);
                members[i] = member.getElement();
              }
              myCopyJavadoc = chooser.isCopyJavadoc();
              return members;
            }
          }
        }
        return PsiMethod.EMPTY_ARRAY;
      });
    if (baseConstructors == null) return null;
    ClassMember[] allMembers = getAllOriginalMembers(aClass);
    ClassMember[] members;
    if (allMembers.length == 0) {
      members = ClassMember.EMPTY_ARRAY;
    }
    else {
      members = chooseMembers(allMembers, true, false, project, null);
      if (members == null) return null;
    }

    List<ClassMember> array = new ArrayList<>();
    for (PsiMethod baseConstructor : baseConstructors) {
      array.add(new PsiMethodMember(baseConstructor));
    }
    ContainerUtil.addAll(array, members);
    members = array.toArray(ClassMember.EMPTY_ARRAY);

    return members;
  }
@Override
  protected ClassMember @Nullable [] chooseOriginalMembers(PsiClass aClass, Project project)