fixed this. also added the iterator(Comparator) method, but do not have time to test this
and i definitely don't have time to write unit tests right now.

Eelco Hillenius wrote:

I just found out - when fixing Tree - that Markup.replace is broken due to the recent child keeping optimizations. This is partly due to the fact that identity is used (==) instead of looking up childs by id. So instead of:

       if (children instanceof Component)
       {
           if (children == child)
           {
               return 0;
           }
       }

we should do:

       if (children instanceof Component)
       {
           if (((Component)children).getId().equals(child.getId()))
           {
               return 0;
           }
       }

I think it is usually bad practice to depend too much on == anyway, as that could give all sorts of problems with serialization too.

After that fix, the next problem shows up. Which can be tested by clicking the 'change add' button in the template example.

But, okay, shit happens. The REALLY BAD thing about this, is that we didn't have any JUnit tests to catch these kind of troubles. More specifically, we really should have had JUnit tests for the whole replace/ undo/ etc stuff long time ago (when we made it, but at least before we refactored it).

I have no time to fix it.

Eelco


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to