IntelliJ IDEA 2021.1 Help

Extract Parameter Dialog for Groovy

Refactor | Extract | Parameter
Ctrl+Alt+P

Use this dialog to specify the options and settings related to the Extract Parameter refactoring in Groovy.

ItemDescription
Type Specify the type of the new parameter. Usually, you don't need to change the type suggested by IntelliJ IDEA.
Name Specify the name for the new parameter.
Declare finalSelect this option to declare the parameter final.
Delegate via overloading methodSelect this option to keep the existing method calls unchanged.

As a result, a new overloading method will be created and the new parameter will be added to the definition of this method. The method with the old signature will be kept. The call to the new method will be added to the old method. The necessary value (or expression) will be passed to the new method in this call.

Remove parameter <name> no longer usedSelect this checkbox to remove a parameter.
Use explicit return statementThis checkbox is active if the method returns a value. You can omit return keyword if it is the last return statement in the method. If you select this checkbox the keyword is returned.
ParametersIn this area, select parameters to be passed to the new method/function.
Move Up/DownUse these buttons to change the order of the parameters.
Signature previewIn this read-only field, view the declaration of the new method/function.
Last modified: 08 March 2021