[Seaside] Bug in Set backtracking

Avi Bryant avi.bryant at gmail.com
Wed Oct 19 17:26:06 UTC 2005

On Oct 17, 2005, at 8:40 PM, David Shaffer wrote:

> I've been having problems with the WATree component and tracked it  
> down
> to the snapshotCopy mechanism performing only a shallow copy of the  
> Set
> used to track expanded nodes.  Maybe this has been fixed in later
> Seaside/Squeak versions but as of Seaside2.5/Squeak3.7 this doesn't
> work.  Attached are a test case (and component) which demonstrate the
> problem and a fix.  I'll post the fix to the Seaside MC repo unless I
> hear that there is a problem with it...

> !Set methodsFor: '*seaside2' stamp: 'cds 10/17/2005 23:30'!
> snapshotCopy
>     ^self copy! !

I'm pretty sure that  you also need to override #restoreFromSnapshot:  
to do a full #copy as well.  Otherwise after a restore, the  
snapshot's internal state will #== the original's internal state, so  
that when you backtrack a *second* time you'll have issues.


More information about the Seaside mailing list