@Override
  protected @NotNull ModCommand perform(@NotNull ActionContext context, @NotNull PsiField field) {
    final PsiClass myClass = field.getContainingClass();
    if (myClass == null) return ModCommand.nop();
    if (myClass.getConstructors().length == 0) {
      return ModCommand.psiUpdate(context, updater -> {
        PsiClass writableClass = updater.getWritable(myClass);
        PsiField writableField = updater.getWritable(field);
        PsiMethod ctor = AddDefaultConstructorFix.addDefaultConstructor(writableClass);
        addFieldInitialization(List.of(ctor), writableField, updater);
      });
    }

    List<PsiMethod> ctors =
      CreateConstructorParameterFromFieldFix.filterConstructorsIfFieldAlreadyAssigned(myClass.getConstructors(), field);
    for (Iterator<PsiMethod> iterator = ctors.iterator(); iterator.hasNext(); ) {
      PsiMethodCallExpression constructorCall = JavaPsiConstructorUtil.findThisOrSuperCallInConstructor(iterator.next());
      if (JavaPsiConstructorUtil.isChainedConstructorCall(constructorCall)) {
        // otherwise final field can be initialized multiple times, which does not compile
        iterator.remove();
      }
    }

    List<PsiMethodMember> allMembers = ContainerUtil.map(ctors, PsiMethodMember::new);
    if (ctors.size() == 1) {
      return getFinalCommand(field, allMembers);
    }

    return ModCommand.chooseMultipleMembers(QuickFixBundle.message("initialize.final.field.in.constructor.choose.dialog.title"),
                                            allMembers, chosenMembers -> getFinalCommand(field, chosenMembers));
  }
@Override
  protected @NotNull ModCommand perform(@NotNull ActionContext context, @NotNull PsiField field)