Extract method - find duplicates behaviour
Hi there,
When extracting a method, IDEA attempts to find similar pieces of code that
can be replaced with an invocation to the new method. This is great. However,
if there are similar pieces of code that have different comments IDEA fails
to recognize them as being the same stuff. Is this by design? If so, can
we have an option to ignore the comments when looking for duplicate code
blocks?
I'll create a jira request if you find it worthwhile (and if there isn't
one there already).
Thx,
Andrei
Please sign in to leave a comment.
I have been just investigating this, and need your opinion if fragments differing by comments only should be considered equivalent.
Eugene Vigdorchik wrote:
IMHO they should, because Idea asks anyway if it should extract each fragment.
Still, if it could alert me in an (unobstrusive way) to the fact that it differs in comments, all the better ;)
Yes.
--Dave Griffith
+1
Fixed.
Wow, that was quick.
Thx,
Andrei
EV> Fixed.
Welcome to the heaven that is the EAP phase :)