Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
REF: Ignore non existing fields #789
I spent a little time today and looked into this more. Its really too bad xstream is implemented this way, as it makes it very difficult to configure this behavior w/o changing the source.
I pulled down the latest trunk (1.4.5-SNAPSHOT) and with this change:
With simple nested group of users:
I can unmarshal this data (which as an invalid foo element):
The new handleUnknownField() is new, not sure when it was added but its not in 1.4.3 (or 1.4.4) so this must be new work they have done on trunk. Perhaps this means they are actually looking to fix this in a proper release and allow this behavior to be changed w/o hacking the codebase.
To patch 1.4.3 (or 1.4.4) we'd have to have a few more lines around the problematic exception throwing code to eat the exception and then move to the next element.
I am not sure what other side-effects this change has however.
Diff for 1.4.4 change looks like this:
Note this doesn't handle missing classes though, which would have to be handled separately, though we might be able to leverage some of the techniques used by hudson here.
Doh, I did not even notice this is already fixed:
Appears that next release will have support to ignore unknown elements... yay.