Hi Peter,

Strange indeed. It did not fail for me in 5.0 with the standard STON version, 
but it does fail in 4.0 with the latest STON. Asking the bogus dictionary to 
#rehash seems to fix the problem. I will investigate and turn you example into 
a unit test.

Sven
 
> On 05 Apr 2016, at 11:14, Peter Uhnák <i.uh...@gmail.com> wrote:
> 
> Hi,
> 
> I ran into a problem with STON that seems to corrupt on materialization.
> 
> Consider the following script:
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> c := OrderedCollection with: UUID new.
> d := Dictionary with: c first -> nil.
> o := { c . d }.
> 
> s := STON toStringPretty: o.
> 
> o2 := STON reader
>       allowComplexMapKeys: true;
>       on: s readStream;
>       next.
>       
> o2 second keys. "an Array(an UUID('571bbfb7-78b9-430c-9aad-3e0088a25f4c'))"
> o2 second printString. "KeyNotFound: key an 
> UUID(''571bbfb7-78b9-430c-9aad-3e0088a25f4c'') not found in Dictionary"
> o2 second at: o2 second keys first. "the same error"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> So even though it contains the key it fails to access it.
> 
> Interestingly enough if I serialize and materialize the "broken" dictionary 
> again it suddenly works again.
> 
> Thanks,
> Peter
> 
> 
> 


Reply via email to