void (BaseExpressionToFieldHandler.Settings settings) { WriteCommandAction.writeCommandAction(myProject).withName(getCommandName()).withGroupId(getCommandName()).run(() -> { if (getLocalVariable() != null) { final LocalToFieldHandler.IntroduceFieldRunnable fieldRunnable = new LocalToFieldHandler.IntroduceFieldRunnable(false, (PsiLocalVariable)getLocalVariable(), getParentClass(), settings, myOccurrences); fieldRunnable.run(); updateVariable(fieldRunnable.getField()); } else { final BaseExpressionToFieldHandler.ConvertToFieldRunnable convertToFieldRunnable = new BaseExpressionToFieldHandler.ConvertToFieldRunnable(myExpr, settings, settings.getForcedType(), myOccurrences, getAnchorElementIfAll(), getAnchorElement(), myEditor, getParentClass()); convertToFieldRunnable.run(); updateVariable(convertToFieldRunnable.getField()); } }); }