Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367672 - [quick assist] [inline] Support Inline Constant refactoring in Quick Assist
Summary: [quick assist] [inline] Support Inline Constant refactoring in Quick Assist
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.8   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-30 15:08 EST by Mohsen Vakilian CLA
Modified: 2012-04-13 11:29 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mohsen Vakilian CLA 2011-12-30 15:08:20 EST
Build id: I20111207-2118

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

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 Constant 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 {
	
	private static final int CONSTANT = 1;

	void m() {
		System.out.println(CONSTANT);
	}
	
}

---
2. Select "CONSTANT" either in the declaration or use of the constant and press "CTRL+1". The Quick Assist menu will open but won't propose the Inline Constant refactoring.

This feature request is similar to Bug 367671.
Comment 1 Deepak Azad CLA 2012-01-01 09:58:22 EST
Makes sense. We already have a 'Inline local variable' quick assist, and I do
not see any reason to not add a 'Inline constant' quick assist.

Fix would be similar to QuickAssistProcessor.getInlineLocalProposal(...)
Comment 2 Markus Keller CLA 2012-04-13 11:29:48 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.