Justin, I have no objection. It should do no harm. However, note that: (1) order should never be important, except for special case subclasses such as SimpleFeatureTypeImpl (see below), and
(2) LinkedHashMap conforms to the Map contract, which guarantees that order is *not* significant for equals/hashCode. Fixing iteration order does not fix this. I experimented with using LinkedHashMap in ComplexTypeImpl to fix SimpleFeatureTypeImpl iteration order, but when I realised it did not fix equals/hashCode, I made all my changes to SimpleFeatureTypeImpl. If you support my position, please join me in nagging Jody to get my patch accepted. Please take a look at it; the patch comes with unit tests for iteration order consistency: http://jira.codehaus.org/browse/GEOT-2338 More importantly, why do you want to change the order of properties? Do you have a non-simple use case in which they matter? If not, please consider my patch. Kind regards, Ben. Justin Deoliveira wrote: > Sorry, i did not mean tree map, just a map with predictable iteration > order. LinkedHashMap should do the trick. > > Justin Deoliveira wrote: >> Hi all, >> >> I think Ben may have brought this up recently, but looking at >> ComplexTypeImpl it seems property values are stored in a hash map, which >> totally throws away the order in which property descriptors are added to it. >> >> Any objection to making this a tree map as to maintain order? -- Ben Caradoc-Davies <[email protected]> Software Engineer, CSIRO Exploration and Mining Australian Resources Research Centre 26 Dick Perry Ave, Kensington WA 6151, Australia ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
