I've tried using Map, HashMap and LinkedHashMap as a type for AutoBean factory and always after serializing it's changing initial elements order.
I don't want to send additional ArrayList that will hold the order data. Is there a way to force AutoBean to keep order in a Map?
http://docs.oracle.com/javase/6/docs/api/java/util/Map.html
GWT doesn't make any alterations to
Map-based classes.Mapand many of its subclasses do not keep order of insertion for performance reasons.LinkedHashMap, by design, does keep its insertion order. That is, of course, assuming you're starting with aLinkedHashMapand not constructing it from another type ofMapwhich may not actually preserve its order during the insertion, causing theLinkedHashMapto have a different order than you're expecting.I'm wondering why you need to keep the initial order anyway, and why are you using
Mapif that's what you want?