Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add a way to choose between class or package instantiation mode for JaxbContext#2005

Merged
velo merged 2 commits intoOpenFeign:masterfrom
jeremybalan:feature/jaxbcontext-package-instantiation
Apr 6, 2023
Merged

Add a way to choose between class or package instantiation mode for JaxbContext#2005
velo merged 2 commits intoOpenFeign:masterfrom
jeremybalan:feature/jaxbcontext-package-instantiation

Conversation

@jeremybalan
Copy link
Contributor

I suggest to add a way to choose between class or package instantiation for JaxbContext (class mode is still used by default).

To allow this, the builder of JaxbContextFactory has a new optional method "withJAXBContextInstantiationMode" to provide an enum for the choice between class and package mode. No call to this method = usage of class mode (backward compatible).

Benefits of a package way can be :

@jeremybalan
Copy link
Contributor Author

Class mode (by default) instantiate a JAXBContext using JAXBContext.newInstance(clazz) as it is actually

And package mode, if chosen, instantiate using JAXBContext.newInstance(clazz.getPackage().getName(), clazz.getClassLoader())

@velo velo merged commit 7557597 into OpenFeign:master Apr 6, 2023
@jeremybalan jeremybalan deleted the feature/jaxbcontext-package-instantiation branch April 6, 2023 19:54
velo added a commit that referenced this pull request Oct 7, 2024
… using package mode (#2005)

Co-authored-by: jernat <[email protected]>
Co-authored-by: Marvin Froeder <[email protected]>
velo added a commit that referenced this pull request Oct 8, 2024
… using package mode (#2005)

Co-authored-by: jernat <[email protected]>
Co-authored-by: Marvin Froeder <[email protected]>
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.

2 participants