Expose ClassLoader from DefaultDeserializer#36833
Conversation
Add a public accessor for the ClassLoader configured on a DefaultDeserializer instance so that callers no longer need to read the private field via reflection in order to forward it to a ConfigurableObjectInputStream subclass. Closes spring-projectsgh-36827 Signed-off-by: seonwoo_jung <laborlawseon@kap.kr>
ClassLoader from DefaultDeserializer
|
Hey, @sbrannen ! any chances this could be back-ported down to 6.2.x for upcoming releases in a week? thanks |
@artembilan, I was literally going to ask you about that offline. 😉 Sure, I think it would be fine to backport this one, since it's only the introduction of an accessor method. |
|
Hi @seonwooj0810, Congratulations on submitting your first PR for the Spring Framework! 👍 In the future, please do not submit a PR for an issue that still has the "status: waiting-for-triage" label. Instead, please ask first on the original issue if the team is willing to accept a PR. Thanks |
Add a public accessor for the ClassLoader configured on a DefaultDeserializer instance so that callers no longer need to read the private field via reflection in order to forward it to a ConfigurableObjectInputStream subclass. See gh-36827 Closes gh-36833 Signed-off-by: seonwoo_jung <laborlawseon@kap.kr> (cherry picked from commit f7be796)
|
Thank you for the review, the merge, and the backport to 6.2.x! I'll make sure to check the issue status and ask on the issue first before submitting a PR next time. |
This commit adds a public
getClassLoader()accessor onDefaultDeserializerto expose theClassLoaderconfigured via theconstructor introduced in 4.2.1.
The motivation for this is described in gh-36827: Spring Integration's
AllowListDeserializingConvertercurrently reads the privateclassLoaderfield viaDirectFieldAccessorreflection in order toforward it to a
ConfigurableObjectInputStreamsubclass. Exposing aproper getter avoids the reflection and removes the need for any
related native image hint.
The accessor mirrors the nullability of the underlying field. A pair of
unit tests in
SerializerTestscover both the no-arg and explicitClassLoaderconstructors.Closes gh-36827