I have another issue:
When want to extract the body of a loop and it has continue statements
in it, I always have to manually replace "continue" with "/*continue*/"
and after the extraction to replace "/*continue*/" with return. The same
for inlining a method in a loop.
Since I often have to deal with old code, I often find myself extracting
some parts of a larger method, refactoring them and if not used
anywhwhere else - inlining them back (or sometimes deleting them :)
Requests:
1. When extracting method which contains a "continue" statement and
returns "void" - change the continue to return (it shouldn't work if the
statement is "continue <label>").
2. This is somewhat ugly, but is stil usefull while refactoring: When
inlining method which has "void" return type and multiple exit points,
wrap the method in a "do{<method_body_here>}while (false)" and replace
each return with break. This especially combined with the new code
inspections could make use.
regards,
dimiter
--__--__--
Message: 58
From: Mark Swinkels <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: RE: [Eap-list] Extract Method with multiple exit points
Date: Tue, 12 Mar 2002 11:09:29 -0800
charset="iso-8859-1"
Reply-To: [EMAIL PROTECTED]
Can you give an example along with what you expect it to do?
Once the method has been extracted the only exit point is by definition
the
call site, there isn't any way to jump from inside the function to
multiple
destinations in the calling code.
I use extract method all the time and have received this error only once
or
twice.
-- Mark
-----Original Message-----
From: Bradshaw, Paul [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 12, 2002 10:25a
To: '[EMAIL PROTECTED]'
Subject: [Eap-list] Extract Method with multiple exit points
Can someone please explain to me why I cannot "extract method" when
there
are multiple exit points? What I have to end up doing is a simple
cut-and-paste. I do not understand why this is disallowed? This makes
this
refactoring almost useless to me. Every single time I've tried to use
it,
it's given me this error, so I have to fall back to cutting and pasting.
Since what I'm doing is so straight-foward, I cannot understand why IDEA
has
this restriction and refuses to just do what I ask it to. Some
enlightenment, please? I figure there has to be a reason, and I'd like
to
know what that is before I file an official "feature request" or "bug
report" on this. :-)
Thanks!
_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list
_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list