[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] eric: Refactoring renaming bug
From:       Detlev Offenbach <detlev () die-offenbachs ! de>
Date:       2004-10-20 17:08:03
Message-ID: 200410201908.03964.detlev () die-offenbachs ! de
[Download RAW message or body]

Hi,

I was able to reproduce the problem and forwarded your report to the 
maintainer of Bicycle Repair Man (the refactoring package). However, your 
statement, that there is no "Undo" is incorrect. BRM comes with it's own undo 
accessible via the Refactoring menu and that did the trick for me.

Regards,
Detlev

Am Mittwoch, 20. Oktober 2004 04:02 schrieb Parzival Herzog:
> Eric seems to rename the wrong thing in some cases, when renaming a global
> variable.
> .
>
> I tried to rename the global "charmap" to "Charmap", by selecting
> the first "charmap" in the snippet below, and using
> Refactoring/Refactoring/Rename:
>
> Original code:
>
> ----------
> charmap = ''.join(map(chr,range(1, maxchar)))
>
> def encode(x, y, charmap=charmap):
>     """ Compute a binary encoding of the difference between string x and
>         string y.
>     """
>     if x == y:
>         return ""
>     if len(x) != len(y):
>         return '\0' + y
>     return b2c(_encode(x, y), charmap=charmap)
> ---------
>
>
> Result:
>
> ----------
> Charmap = ''.join(map(chr,range(1, maxchar)))
>
> def encode(x, y, Charmap=charmap):
>     """ Compute a binary encoding of the difference between string x and
>         string y.
>     """
>     if x == y:
>         return ""
>     if len(x) != len(y):
>         return '\0' + y
>     return b2c(_encode(x, y), charmap=charmap)
> -----------
>
>
> Notice that the formal parameter name is erroneously renamed, while the
> default value expression which refers to the renamed global is not altered.
>
> There is also no undo for this change, and the file is altered, so the
> consequences of this bug could be difficult to reverse in some
> circumstances.

-- 
Detlev Offenbach
detlev@die-offenbachs.de

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic