2005/9/13, Simon Groenewolt <[EMAIL PROTECTED]>:
> I've done some more searching myself ... and am completely confused
> about MMObjectNode.java, and particularly the 'setValue()' method.
>
> What actually is the meaning of the (boolean) return value of
> parent.setValue() and who is responsible for doing the updates?
>
> In case of the UserBuilder.java class it looks like both MMObjectNode
> and UserBuilder do set values in values Hashtable, and there are
> situations in which UserBuilder.setValue returns false but the
> storeValue method of MMObjectNode will always have been called before that.
>
> Hoping for some enlightenment...
I think we should deprecated the setValue methods in MMObjectBuilder.
They are indeed not very intuitively clear, are overriden in only
three places, mostly to make fields 'unmodifiable'. I think you can
make a field unmofiable too by marking it 'system' or with some
field-processors.
I think UserBuilder simply restores the original value, and in that
way achieves that the field is unmodifiable. If you do setValue on
that field, in MMObjectNode first the original value is determined
('storeOldValue') and then the new value is set. Then, parent's
'setValue' is checked, which may restore the original value and return
false, and the node is left 'unchanged'.
Yes, perhaps it would have been more logical to not set the value in
the first place then, but I don't as yet see an actual bug here.
Michiel
--
mihxil' http://mihxil.komputilo.org/
nl_NL eo_XX en_US
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers