Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
JavaBeanConverter is not handling the IgnoreUnknownElements flag #29
My post from Google Groups:
I am using XStream 1.4.7 to handle de/serialisation of POJOs. As the project develops, I will need to add new features and therefore new class fields. I would like old versions of the app to handle these changes gracefully and to ignore unknown tags.
Yesterday I added a String field to one of my classes and serialised it. An older version of the app was not able to deserialise the xml.
Should I be doing this a different way?
UPDATE If I comment out the registerConverter call, then the unknown fields are ignored. The JavaBeanConverter seems to be affecting the way the ignoreUnknownElements is handled. The TransientRespectingBeanProvider is intended to ignore properties which have a @Transientannotation.
My workaround was to override the JavaBeanConverter and make the following patch:
Somewhere near Line 142 in unmarshall() ...
Hope the workaround is not too naïve but it works for me.