You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been struggling with a Magritte validation problem. I find that a
condition I add (using #addCondition:labelled:) to a MABooleanDescription is
only intermittently called.
I've simplified the conditions to reproduce the problem to a component
description comprising of two MABooleanDescription descriptions. The second
description includes the condition which is intermittently called.
If the value of the first description is true (ie the checkbox is checked) the
second description's condition will be executed, however if it is false it will
never be executed.
I suspect the problems lies in the code in
MAValidatorVisitor>>#visitContainer: which calls MAGraphVisitor>>#use:during:
which is as follows:
MAGraphVisitor >>use: anObject during: aBlock
| previous |
(seen includes: anObject)
ifTrue: [ ^ self ].
anObject isNil
ifFalse: [ seen add: anObject ].
previous := object. object := anObject.
aBlock ensure: [ object := previous ]
If the first check box is false, and the second is also false then (seen
includes: anObject) will return true and method returns early resulting in
block associated with second description (self visit: description) never being
executed.
I've attached a file out of a simple component TestMagritteValidation
illustrating the problem that I tested in the latest build from Hudson.
Thanks
Nick
Original issue reported on code.google.com by renggli on 11 Oct 2010 at 7:29
The text was updated successfully, but these errors were encountered:
Not limited to MABooleanDescription, but to any description that can describe
an identical object multiple times, e.g. MANumberDescription,
MAClassDescription, MASingleOptionDescription, MASymbolDescription, ...
Original comment by renggli on 11 Oct 2010 at 7:34
Original issue reported on code.google.com by
renggli
on 11 Oct 2010 at 7:29The text was updated successfully, but these errors were encountered: