Ensured *Builder instances are no longer created with reflection #989
Ensured *Builder instances are no longer created with reflection #989lhazlewood merged 5 commits intomasterfrom
Conversation
…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.
|
@slovdahl are you able to build using this PR and test in your application? |
|
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. |
|
@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. |
Ensured
*Builderinstances are no longer created with reflection usingClasses.newInstance. Instead,Classes.newInstanceis used to create static/thread-safe Supplier singletons when the api module is loaded, and those singletons will directly instantiate*Builderinstances at runtime using thenewkeyword`.Resolves #988.