Menu

#14 Deserialization does not happen in declaration order

open-fixed
nobody
None
5
2010-12-20
2010-07-15
Mark Hale
No

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
}

Discussion

  • Niall Gallagher

    Niall Gallagher - 2010-12-20
    • status: open --> open-fixed
     
  • Niall Gallagher

    Niall Gallagher - 2010-12-20

    The Registry is not a linked hash map.

     

Log in to post a comment.