This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 211351

Summary: "Extract Class" and "Move method" refactor options.
Product: java Reporter: jonathanvilalopez <jonathanvilalopez>
Component: RefactoringAssignee: Ralph Ruijs <ralphbenjamin>
Status: REOPENED ---    
Severity: normal CC: ralphbenjamin
Priority: P2    
Version: 7.1.1   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description jonathanvilalopez 2012-04-17 16:12:47 UTC
Product Version = NetBeans IDE 7.1.1 (Build nbms-and-javadoc-9049-on-20120405)
Operating System = Linux version 3.0.0-17-generic running on amd64
Java; VM; Vendor = 1.7.0_03
Runtime = Java HotSpot(TM) 64-Bit Server VM 22.1-b02

It would be so usefull to add some commands to the refactor command list : "Extract Class" just to extract some methods from the current class and create a new class, move the methods there and refactor the current class.
Also the command "Move method" to move methods from the current class to another.
Comment 1 Ralph Ruijs 2012-04-19 09:25:20 UTC
I f I understand correctly; the refactor command, list is the refactoring menu? In NetBeans 7.2 (avaiable in the current dev builds [1]) move is extended to also support moving (instance) methods and variables.

Please reopen the issue if I misunderstood.

Comment 2 jonathanvilalopez 2012-04-19 14:58:12 UTC
Oki, ralphbenjamin.

When I mention "refactor command list" I mean the Refactor menu options.

But what about the feature "Extract Class" ?I've seen in the new version 7.2 ( nightly build ) that the Move refactor option allows to move class members to an already created class.

But, that would need to first create a new empty class and then move the members to it..... 

I think that if package and class drop down objects allow enter free text that would also allow to create a new class and move the members in that class.
Comment 3 Ralph Ruijs 2012-04-19 15:16:10 UTC
*** Bug 208165 has been marked as a duplicate of this bug. ***
Comment 4 Ralph Ruijs 2012-04-19 15:21:00 UTC
Thanks you for the clear description. I agree, it should be possible to move members (methods/fields) to a new Class in a possible new package.

As we passed the feature freeze for 7.2 and this change requires some new precondition checking and different transformations, I'm not sure if this will be implemented in 7.2, but I will look into it.
Comment 5 jonathanvilalopez 2012-09-13 10:59:56 UTC
Will this new refactoring feature ( move members to a new empty class not existing yet ) be included in the 7.3 release ?