Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 367671

Summary: [quick assist] [inline] Support Inline Method refactoring in Quick Assist
Product: [Eclipse Project] JDT Reporter: Mohsen Vakilian <reprogrammer>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: deepakazad, markus.kell.r, reprogrammer
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Mohsen Vakilian CLA 2011-12-30 15:00:19 EST
Build id: I20111207-2118

The Quick Assist menu supports refactorings such as Extract Method, Extract Local Variable, and Inline Local Variable, but not Inline Method.

One of the results of the CodingSpectator <http://codingspectator.cs.illinois.edu/> study was that Quick Assist is a preferred method of invoking refactorings. I think that adding Inline Method to Quick Assist would be a natural extension of Quick Assist. However, I didn't find any bug reports on this issue. So, I decided to open one.

Steps to Reproduce:

1. Add a class called "C" with the following contents to a Java project:
---
// C.java
public class C {
	
	void m1() {
		System.out.println("m1");
	}
	
	void m2() {
		m1();
	}

}
---
2. Select "m1" either in the declaration or use of the method and press "CTRL+1". The Quick Assist menu will open but won't propose the Inline Method refactoring.
Comment 1 Mohsen Vakilian CLA 2011-12-30 15:09:06 EST
This feature request is similar to the one in Bug 367672.
Comment 2 Deepak Azad CLA 2012-01-01 09:57:45 EST
Makes sense. We already have a 'Inline local variable' quick assist, and I do not see any reason to not add a 'Inline method' quick assist.

Fix would be similar to QuickAssistProcessor.getInlineLocalProposal(...).
Comment 3 Markus Keller CLA 2012-04-13 11:30:10 EDT
Quick Assist/Fix actions are intended to be quick local actions that only change a single file. We won't add refactorings as quick assists if they touch more than one file.

We could do something like bug 354147, but just adding all commands one by
one as quick assist is not a good strategy.