IntelliJ IDEA provides the following inline refactorings:
- Inline Variable refactoring replaces redundant variable usage with its initializer. See example. This refactoring is opposite to the Extract Variable refactoring.
- Inline Method refactoring results in placing method's body into the body of its caller(s). You can opt to:
- inline all occurrences of the method, and delete the method
- inline only a single occurrence, and retain the method
This refactoring is opposite to Extract Method.
- Inline to Anonymous Class refactoring allows replacing redundant class with its contents.
- Inline Constructor allows compressing a chain of constructors, if one of them is a special case of another. Seeexample.
- Inline JSP/JSPX works like a regular Java inline refactoring.
- Inline Superclass refactoring results in pushing superclass' methods into the class where they are used, and removing the superclass.
To perform the inline refactoring
Last modified: 18 July 2017