Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Jackson's XML reader instead of JAXB.unmarshal for ModelInfo files #745

Merged
merged 9 commits into from
May 20, 2022

Conversation

vitorpamplona
Copy link
Contributor

@vitorpamplona vitorpamplona commented May 3, 2022

This PR replaces JAXB with Jackson for loading ModelInfo files, making it suitable for use on Android. It fixes #640

Notice that:
1 - There were typos on the modelinfo files: primaryCocdePath and primaryCOdePath (Jackson XML is case sensitive)
2 - There is a bug on Jackson's XML mapper that requires xsi:type to be the first property on XML elements with polymorphic nested objects.

IntelliJIdea can run a replace all with:

From: <typeInfo ([^>]*) xsi:type="ClassInfo">
To: <typeInfo xsi:type="ClassInfo" $1>

@vitorpamplona vitorpamplona changed the title Standing PR: Migrating JAXB.unmarshal to Jackson's XML reader of ModelInfo files Using Jackson's XML reader instead of JAXB.unmarshal for ModelInfo files May 4, 2022
Copy link
Member

@brynrhodes brynrhodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, builds locally, all tests pass

@rob-reynolds
Copy link

LGTM. Builds locally, all tests pass.

@rob-reynolds
Copy link

Also, researched the performance implications and I didn't run performance metrics personally, but from what I can tell the Jackson reader should be more performant.

@brynrhodes brynrhodes merged commit ec57b25 into cqframework:master May 20, 2022
@vitorpamplona vitorpamplona deleted the jaxb-to-jackson-xml-read branch May 20, 2022 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support JSON as a serialization format for ModelInfo
3 participants