Goods + TreeSet>>keyForValue: problems: Bug?

David Shaffer cdshaffer at acm.org
Sat Feb 19 16:12:55 UTC 2005


I wrote:

> Attached is an SUnit test that summarizes the problem I'm having.  
> Edit the connect method to point to a spare GOODS server and run the 
> tests.  Debug the errors and you'll find that trying to send perform: 
> #number to the TreeSetBugObject causes a DNU but clearly these object 
> do understand that message.  Inspect the message target and manually 
> set it number....works fine.  Inspect the message target (anObject) 
> and manually send it perform: #number...works fine.  Strange.  I'm 
> guessing that it is proxy related by my eyes are tired at this point.
>
> Has anyone seen this kind of problem (TreeSet throws exception when 
> testing inclusion?)?  Any ideas?
>
> David
>
I think I found a fix...in TreeSet:

keyForValue: anObject
    ^ anObject perform: sortKey yourself

Seems that a proxy was being passed as the argument to perform:.  That 
was causing the problem.  Making this change causes my tests to pass 
(and fixes this problem in my own code).

David




More information about the Squeak-dev mailing list