Repetive problem with indexed attribute

Chris Muller asqueaker at gmail.com
Fri Feb 8 05:01:29 UTC 2008


Hilaire, thanks for the report.  However, I can't make a determination
whether you've identified a bug or not since I can't see what you have
for your #functions getter.  And there's a lot of other code I don't
have the benefit of seeing, so can only pretty much just speculate
about the possibilities..

It sounds like you've narrowed the problem down to a reproducible
test-case script.

If you can show me how to reproduce the problem, perhaps with a
workspace script that adds instances of Association indexed on #key
and/or #value, I'd be happy to work on it.

Thanks,
  Chris




On Feb 7, 2008 9:00 AM, Hilaire Fernandes <hilaire at ofset.org> wrote:
> In my quest to write tests to control Magma behaviour, I have found the
> following problem:
>
> With a magma collection of users object defined as follow:
>
> | users |
> users := MagmaCollection new.
> users
>         addIndex: (MaIntegerIndex attribute: #id);
>         addIndex: (MaKeywordIndex attribute: #functions);
>         addIndex: (MaSearchStringIndex attribute: #schoolYear).
> ^ users
>
> I have problem with the #functions key.
> functions is instanciated as an empty OrderedCollection.
> I can update function with #function: message
>
> functions: aCollection
> (self class functions includesAllOf: aCollection)
>         ifTrue:
>                 [IFIDbSession commit:
>                         [IFIDbSession noteOldKeyFor: self.
>                         functions := aCollection]]
>
>
> In my test, I can do:
>
>         adult functions: #(#teacher).
>         self should: adult functions = #(#teacher).
>
> but the next one got the error (see SqueakLog enclosed)
>
>         adult functions: #(#teacher #admin).
>         self should: adult functions = #(#teacher #admin).
>
> If I change the previous test code to:
>         adult functions: #(#director #admin ).
>         self should: adult functions = #(#director #admin ).
>
> It is fine.
>
> It seems the problem appear when two successive changes to functions has
> common value, here #teacher was in both #(#teacher) and #(#teacher
> #admin)
>
> Please help!
>
>
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
>
>


More information about the Magma mailing list