GoogleCloudPlatform / functions-framework-java

FaaS (Function as a service) framework for writing portable Java functions
Apache License 2.0
130 stars 63 forks source link

fix: set Thread Context ClassLoader correctly when invoking handler constructor #239

Closed garethgeorge closed 10 months ago

garethgeorge commented 10 months ago

Adds the same logic that is used to set the Thread Context ClassLoader when handling a request to also apply that same class loader when constructing the handler.

Addresses issue https://github.com/GoogleCloudPlatform/functions-framework-java/issues/110

kenneth-rosario commented 10 months ago

It be good if we had a test that can guard against regressing to the old behavior. Not sure how complex testing this would be though. WDYT?

garethgeorge commented 10 months ago

Good point, done. Added test coverage.