On Thursday 29 July 2004 16:31, Leo Sutic wrote:
> Reasoning goes like this:
>
>     getChildren
>     public Configuration[] getChildren()
>     Return an Array of Configuration elements containing all node children.
>     The array order will reflect the order in the source config file.
>
> Since order matters in the translation from source file to
> Configuration, we must conclude that order is significant. Otherwise,
> if you have code that is based on the assumption that the node order
> == order in config file, then that code will not consider two
> configurations equal, even if equals() does.

Agree.
And in fact, the equals() implementation along these lines are a lot simpler. 
Just do an equals() on each of the members in the instances.
Attributes are internally stored in HashMap, which is not order sensitive, 
whereas children are stored in an ArrayList, which is order-sensitive.

Hence, I have now committed the change to the subversion repo, together with a 
supporting testcase.


Cheers
Niclas
-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to