IntelliJ IDEA 2022.2 Help

Inline Method

Refactor | Inline

Inline Method refactoring places method's body into the body of its caller(s). You have the option to:

  • inline all occurrences of the method, and delete the method

  • inline only a single occurrence, and retain the method



Inline all invocations and remove the method

Select this option to replace all the method calls with its code and remove the method.

Inline this invocations only and keep the method

Select this option to replace only the current method call.

Search in comments and strings

Select this checkbox to display the usages of methods in comments and strings in the Refactoring Preview tool window.

Search for text occurrences

Check this option to apply the changes to non-java files (such as documentation, HTML, JSP and other files included in the project).


Click this button to see the expected changes prior to actually performing the refactoring.


Click this button to perform the refactoring right away.

Last modified: 08 March 2021