Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 211351 - "Extract Class" and "Move method" refactor options.
"Extract Class" and "Move method" refactor options.
Product: java
Classification: Unclassified
Component: Refactoring
All All
: P2 with 1 vote (vote)
: 7.3
Assigned To: Ralph Ruijs
: 208165 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2012-04-17 16:12 UTC by jonathanvilalopez
Modified: 2012-09-13 10:59 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
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 ?

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo