[BUG] Class renaming
Phil Hargett
hargettp at mindspring.com
Wed Nov 12 12:51:24 UTC 2003
Thanks for looking into it!
I can report that adding the line "name := newName" back to the method
at the end seems to work well, but I don't know everything to test to
ensure correct behavior (e.g. ChangeSets, SystemDictionary,
SystemOrganizer, etc.)
:)
On Nov 12, 2003, at 7:35 AM, Roel Wuyts wrote:
> There was a problem with the renaming somewhere in 3.6 for which I
> submitted a fix, which I think was reviewed and accepted. It is
> possible that afterwards it got mangled with some other KCP
> changesets, resulting in some problems. I'll have a look and fix the
> current one.
>
> The original problem was that #rename: on class did not work, but
> SystemDictionary>>renameClass: worked. I fixed it so that both worked
> as expected. But since SystemDictionary was being refactored in the
> meantime it is possible that currently two things gor merged in the
> wrong way. Have to check...
>
> On 12 Nov 2003, at 13:04, Phil Hargett wrote:
>
>> I could be missing something, but I found myself very confused
>> yesterday when I attempted to use Class>>rename: to rename some
>> classes in one of my projects. Since I needed to change the suffix
>> on more than a dozen classes, I figured doing this programmatically
>> would be the simplest, so I write a small line of code that created a
>> collection of my classes, then invoked #rename: on each one with the
>> new name.
>>
>> However, what I found is that after the renaming, the Class instances
>> themselves had not changed their names! If I viewed the class in the
>> Browser, the name in the Class pane was correct (the new name), but
>> the class name listed in the class definition was the old one!
>> Further, if I examined the SystemDictionary had stored at the
>> symbolic name for the class I discovered that a class was stored
>> there that reported the *old* name for the class.
>>
>> Best as I can gather by looking at the versions of the Class>>rename:
>> method, in changeset 5457 (Squeak 3.7 alpha), a ClassRenameFix was
>> applied that dropped any assignment to the Class's name instance
>> variable. Whereas prior to that change the last line of the method
>> read name := newName, no such assignment occurs now. Further, I
>> could find no such assignment or invocation of Class>>setName:, the
>> private method for performing that assignment. Oh, and I tried
>> renaming a class through the browser, and it has the same effect:
>> renames the class in SystemDictionary and SystemOrganization, but
>> doesn't rename the Class object itself.
>>
>> If there's some background housekeeping task that updates names (and
>> I missed it) that's great; would love the education. Otherwise, I
>> think we have a bug.
>>
>>
> Roel Wuyts
> DeComp
> roel.wuyts at ulb.ac.be Université Libre de
> Bruxelles
> http://homepages.ulb.ac.be/~rowuyts/
> Belgique
> Board Member of the European Smalltalk User Group: www.esug.org
>
>
More information about the Squeak-dev
mailing list
|