Skip to content

Ensured *Builder instances are no longer created with reflection #989

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

Merged
merged 5 commits into from
Apr 22, 2025

Conversation

lhazlewood
Copy link
Contributor

Ensured *Builder instances are no longer created with reflection using Classes.newInstance. Instead, Classes.newInstance is used to create static/thread-safe Supplier singletons when the api module is loaded, and those singletons will directly instantiate *Builder instances at runtime using the new keyword`.

Resolves #988.

…g `Classes.newInstance`. Instead, `Classes.newInstance` is used to create static/thread-safe Supplier singletons when the api module is loaded, and those singletons will directly instantiate *Builder instances at runtime using the `new` keyword`.

Resolves #988.
@lhazlewood
Copy link
Contributor Author

@slovdahl are you able to build using this PR and test in your application?

@lhazlewood lhazlewood self-assigned this Apr 11, 2025
@slovdahl
Copy link

Thanks a lot for working on this! 🙇

I'll try to get it tested, but a problem right now is that we're still stuck on 0.11.x, and we get some runtime failures when upgrading to 0.12 that we have yet to solve. It might be easier for me to build a 0.11.x version with just this change applied. I'll try to get that done in the coming days.

@lhazlewood
Copy link
Contributor Author

@slovdahl I've decided to merge this because it's a little better for runtime performance in all environments, regardless of Tomcat's particular ClassLoader behavior. Maybe you can cherry pick this particular PR/commit for testing in your 0.11.x branch - please let us know how it goes!

I'll just add some release note edits to this first and do one more build before merging.

@lhazlewood lhazlewood added this to the 0.12.7 milestone Apr 22, 2025
@lhazlewood lhazlewood merged commit f1fde23 into master Apr 22, 2025
23 checks passed
@lhazlewood lhazlewood deleted the issue-988-builder-factories branch April 22, 2025 21:38
@lhazlewood lhazlewood mentioned this pull request Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runtime Builder creation enhancements
2 participants