Community
Participate
Working Groups
When refactoring procedural code, you often have to remove parameters and inline the expression which is used as actual argument. We should have a refactoring which inlines a selected actual argument expression in a method call. It should remove the parameter in the method declaration and in calls to the method, and replace usages of the parameter by the selected expression. Example: void update(Node node) { // use node without assigning to it: ... node.getParent() ... } void callerOne() { ... update(getNode()) ... } // or update(fNode), ... void callerTwo() { ... update(getNode()) ... } // or update(fNode), ... ... ==> inline "getNode()" ==> void update() { ... getNode().getParent() ... } void callerOne() { update() } ...
the change signature refactoring could have this feature: for each removed parameter: create a local variable for it if the reference is still used and initialize it if all callers use it with the same expression (which is not very often the case, e.g. in you example, your method could have side effects and the refactoring would be a program change)
*** Bug 107855 has been marked as a duplicate of this bug. ***