[squeak-dev] Browser gets confused when renaming class

Frank Shearar frank.shearar at angband.za.org
Mon Apr 25 09:23:09 UTC 2011


On 2011/04/25 09:09, Balázs Kósi wrote:
> Hi,
>
> To reproduce: Create a class Foo add a method #foo, while the method
> is selected bring up the context menu for the class and rename it to
> Bar. You'll be greeted with some debuggers. I guess in Browser>>
> #renameClass the selectedClassName don't gets updated.

I'm not at all surprised to see bugs in this method: it's one of the 
places where I couldn't see how to write tests to document the existing 
behaviour before changing things.

Tools-fbs.343 should address the issue. (Read: I tested it, but didn't 
write a test for it, and the test suite is still green.)

In this case, we notify of an updated classList before we've updated our 
selectedClassName.

Technically I could have just moved the #classListIndex: before the 
#update: but this looks cleaner anyway. (When you set an instvar you can 
be (pretty) sure no further effects will happen. You can't say the same 
for using #selectClassNamed: and so on, because those trigger update 
notifications.)

frank



More information about the Squeak-dev mailing list