IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Remove middleman

Last modified: 10 August 2022

Required plugin: Additional Java Refactorings (installed and enabled)

The Remove Middleman refactoring lets you replace all calls to delegating methods in a class with the equivalent calls directly to the field delegated to. Additionally, you can automatically remove the classes delegating methods, which will now be unused.

This refactoring is useful if you have a class that simply forwards many of its method calls to objects of other classes, and you wish to simplify your design.