Deserialization does not happen in declaration order
Brought to you by:
niallg
Deserialization does not happen in declaration order, although serialization does (by default). This causes difficult to reproduce problems in code that mistakenly assumes a deterministic deserialization order. The cause seems to be due to Collector.Registry extending HashMap and not LinkedHashMap. It may also be helpful to have an annotation that specifies a method to be called after all the setters have been called:
@Element
void setData(...)
{
this.data = data;
}
@Post-init
void postInit()
{
// do stuff
}
The Registry is not a linked hash map.