Plea for improvements to Extract Method and Move Method

I use Extract Method and Move Method all the time, many times per day.
They could be much more useful and productivity boosting if these were
implemented for Demetra:

Extract Method should allow user to choose which class to create
extracted method in
http://jetbrains.net/jira/browse/IDEABKL-3496

Extract Method: keep order of parameters
http://jetbrains.net/jira/browse/IDEABKL-2795

Add advanced Extract Method dialog
http://jetbrains.net/jira/browse/IDEABKL-2833

Extract Method should recalculate parameters if static option is selected
http://jetbrains.net/jira/browse/IDEABKL-1679

Unify Move Instance Method and Move Static Method dialogs
http://www.jetbrains.net/jira/browse/IDEABKL-3090

Extract Method should create inner class for multiple return values
http://jetbrains.net/jira/browse/IDEABKL-2814

I think these would fill huge holes in IDEA's refactoring capabilities,
which have been lingering for years, and of course they would save me
lots of time and provide a more intuitive, simpler interface to new users.

Given the recent posts about stronger refactoring improvements lacking
in the Demetra roadmap, I think this will get some support. I think each
of these should be marked for Demetra and everyone should vote 100 times
for each one.

9 comments

For myself, allowing extraction of tail usages and gaurd usages with multiple returns would be the best change. Similarly with inlining.

It should be noted that improvements to Extract Method are on the Demetra roadmap, so griping may be premature.

--Dave Griffith

0

That's exactly what I'm hoping the text "Extract method refactoring enhancements. Will work in some cases, where it currently refuses to." on the roadmap means. I want it.

Bas

0

Dave, what do you call tail usages, and how is it related to extract method?
As for guard usages, this is alreday implemented in Demetra.

Eugene.

"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:16281937.1134064141248.JavaMail.javamailuser@localhost...

For myself, allowing extraction of tail usages and gaurd usages with
multiple returns would be the best change. Similarly with inlining.

>

It should be noted that improvements to Extract Method are on the
Demetra roadmap, so griping may be premature.

>

--Dave Griffith



0

By tail usage, I mean that any sequence of methods that is gauranteed to end by either returning (including thing implicit void/constructor return) or throw an exception, may be extracted, regardless of how many return points it contains. Unless such sequences are in a try block, they may be extracted no matter how much local state they modify (as that state is gauranteed to be destroyed on return).

Conversely, any method call whose value is immediately returned should be inline-able, no matter how many return points the method has.

--Dave Griffith

0

Got you.
If the sequence is guaranteed to return, then we build a control flow with a
single return point, and this works even now (modulo the recently fixed bug
found in Oxford:)

Eugene.

"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:2698749.1134141018750.JavaMail.javamailuser@localhost...

By tail usage, I mean that any sequence of methods that is gauranteed to
end by either returning (including thing implicit void/constructor return)
or throw an exception, may be extracted, regardless of how many return
points it contains. Unless such sequences are in a try block, they may be
extracted no matter how much local state they modify (as that state is
gauranteed to be destroyed on return).

>

Conversely, any method call whose value is immediately returned should be
inline-able, no matter how many return points the method has.

>

--Dave Griffith



0

Excellent.

While I'm at it, is there likely to be any progress in extracting from the middle of associative operation sequences. It really would be handy to be able to extract
from the middle of long string concatenations.

--Dave Griffith

0

Dave Griffith wrote:

While I'm at it, is there likely to be any progress in extracting from the middle of associative operation sequences. It really would be handy to be able to extract
from the middle of long string concatenations.


Shameless plug: That's something the SmartIntroduce plugin does ;)

(The version currently offered for 4XXX builds is rather old though, but the version for
3XXX builds just works fine - will put out an update soon)

Sascha

0

No, I haven't made any progress yet.

Eugene.

"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:6917884.1134145438603.JavaMail.javamailuser@localhost...

Excellent.

>

While I'm at it, is there likely to be any progress in extracting from the

middle of associative operation sequences. It really would be handy to be
able to extract

from the middle of long string concatenations.

>

--Dave Griffith



0

Please sign in to leave a comment.