this would be much simpler then the current implementation that performs an optimization that saves a lot of what would be wasted session space. calling removeall() on a container with 20 children using the simple implementation would cause 20 change objects created and added to the version history, while using the current implementation only a single change object is created. the net effect is the same.
so this is a tradeoff between user's assumption of how the code works and efficiency ( how it actually works ).
if you feel strongly about this then start a vote to change the removeall() impl to cascade remove() on each component.
-Igor
On 12/28/05, Gili <[EMAIL PROTECTED]> wrote:
I (partially) disagree. Invoking removeAll() should be equivilent to
invoking remove() on all children individually -- assuming no
subclassing has occured. removeAll() might be more efficient, but if it
doesn't get the job done what's the point? If subclassing has entered
into the discussion then both remove() and removeAll() will have to be
subclassed as a team (similar to hashCode() and equals()).
Gili
Igor Vaynberg wrote:
> i do not think removeAll() should call the regular remove(). removeAll()
> generates a single change object and clears out the children, i think
> that is enough. it does what it says in a simple and efficient way.
>
> -Igor