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

Bug 506229

Summary: [extract method] Refactor > Extract Method... should fill in the method name "extracted"
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Noopur Gupta <noopur_gupta>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: rgrunber
Version: 4.6   
Target Milestone: 4.12 M3   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/140747
https://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=eabd059a8747d8a367a9daf461d5ab0c0979eda1
Whiteboard:
Bug Depends on:    
Bug Blocks: 547572    

Description Dani Megert CLA 2016-10-19 12:46:52 EDT
Never worked.

Refactor > Extract Method... should fill in the method name "extracted". It already displays that name at the bottom (signature preview).

Also, using the Extract Method Quick Assist, it uses that name by default.
Comment 1 Eclipse Genie CLA 2018-11-19 05:21:07 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Noopur Gupta CLA 2019-04-17 06:00:48 EDT
The method name 'extracted' should be pre-filled and selected.
Comment 3 Eclipse Genie CLA 2019-04-17 07:44:09 EDT
New Gerrit change created: https://git.eclipse.org/r/140747
Comment 5 Roland Grunberg CLA 2019-05-22 14:24:28 EDT
Version: 2019-06 (4.12)
Build id: I20190411-0625

I ran into an issue that I think is caused by this change.

When going to Refactor -> Extract Method given a text selection, the 'Ok' button remains disabled, even when the 'Method name' text box is filled with 'extracted'. One must make some change in the text box to get the button to update its initial state.
Comment 6 Roland Grunberg CLA 2019-05-22 16:27:09 EDT
(In reply to Roland Grunberg from comment #5)
> Version: 2019-06 (4.12)
> Build id: I20190411-0625

I meant I20190522-0600. I20190411-0625 is 4.12 M1, which I used to confirm what the previous behaviour was.
Comment 7 Noopur Gupta CLA 2019-05-23 02:03:00 EDT
(In reply to Roland Grunberg from comment #5)
> Version: 2019-06 (4.12)
> Build id: I20190411-0625
> 
> I ran into an issue that I think is caused by this change.
> 
> When going to Refactor -> Extract Method given a text selection, the 'Ok'
> button remains disabled, even when the 'Method name' text box is filled with
> 'extracted'. One must make some change in the text box to get the button to
> update its initial state.

On opening the wizard, the OK button used to be disabled until the user makes a change before this fix also.

However, since we pre-fill a default method name now, the OK button can be enabled based on the page validation state. I will open a bug for RC1 to handle this.
Comment 8 Noopur Gupta CLA 2019-05-23 04:47:37 EDT
Opened bug 547572 for buttons enablement.

Verified in I20190522-1800.