Bug 118032 - [refactoring] Make instance method static (add 'this' as parameter if necessary)
Summary: [refactoring] Make instance method static (add 'this' as parameter if necessary)
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 enhancement with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 338449 (view as bug list)
Depends on:
Blocks: 232660
  Show dependency tree
 
Reported: 2005-11-25 06:23 EST by Thomas Singer CLA
Modified: 2015-12-22 16:02 EST (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Singer CLA 2005-11-25 06:23:21 EST
If necessary, pass the instance as method parameter
Comment 1 Martin Aeschlimann CLA 2005-11-28 04:09:50 EST

*** This bug has been marked as a duplicate of 10605 ***
Comment 2 Thomas Singer CLA 2005-11-28 04:45:23 EST
Sorry, it is no direct duplicate of bug 10605. I want to make the current selected method to become static, passing the instance as parameter if necessary.

bug 10605 wants to make all methods in a class static without passing the instance as parameter if required.
Comment 3 Martin Aeschlimann CLA 2005-11-28 07:05:18 EST
If you can convert all you can also convert only one. But, I guess if we do it we would only work on one.

The refactoring would allow you to chose to pass the instance or select the fields that go in as parameters. But passing the instance is the most likely scenario.

*** This bug has been marked as a duplicate of 10605 ***
Comment 4 Thomas Steininger CLA 2007-03-13 04:56:40 EDT
I don't understand why this case is closed.
It is still (eclipse 3.2.2) not possible to refactor a method to static, if it contains access to instance-fields.
Comment 5 Thomas Singer CLA 2007-03-13 07:45:24 EDT
Reopened this issue
Comment 6 Martin Aeschlimann CLA 2007-04-25 05:12:38 EDT
*** Bug 10605 has been marked as a duplicate of this bug. ***
Comment 7 Thomas Singer CLA 2007-04-25 07:15:41 EDT
Please note, that Bug 10605 differs from this one, that it wants all possible methods to be converted to static where as this one just wants to make the current selected method static, even when it uses instance methods/variables.
Comment 8 Dani Megert CLA 2010-06-08 07:15:43 EDT
>Please note, that Bug 10605 differs from this one
Correct.
Comment 9 Markus Keller CLA 2010-06-09 02:13:22 EDT
This refactoring will do something similar to Move Instance Method (add a parameter for 'this'), so we should also try to share the implementation.
Comment 10 Raksha Vasisht CLA 2010-11-30 05:30:53 EST
Moving to M5..
Comment 11 Raksha Vasisht CLA 2011-01-18 05:27:50 EST
Moving to M6..
Comment 12 Markus Keller CLA 2011-03-01 05:53:05 EST
*** Bug 338449 has been marked as a duplicate of this bug. ***
Comment 13 Emond Papegaaij CLA 2014-01-30 16:39:08 EST
A simple workaround is to create the static method, call this static method from the method you want to become static and inline the method call. This works for me in 4.3.1.