Skip to content

Expose ClassLoader from DefaultDeserializer#36833

Open
seonwoo-jung wants to merge 1 commit into
spring-projects:mainfrom
seonwoo-jung:gh-36827-default-deserializer-classloader
Open

Expose ClassLoader from DefaultDeserializer#36833
seonwoo-jung wants to merge 1 commit into
spring-projects:mainfrom
seonwoo-jung:gh-36827-default-deserializer-classloader

Conversation

@seonwoo-jung
Copy link
Copy Markdown

This commit adds a public getClassLoader() accessor on
DefaultDeserializer to expose the ClassLoader configured via the
constructor introduced in 4.2.1.

The motivation for this is described in gh-36827: Spring Integration's
AllowListDeserializingConverter currently reads the private
classLoader field via DirectFieldAccessor reflection in order to
forward it to a ConfigurableObjectInputStream subclass. Exposing a
proper 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 SerializerTests cover both the no-arg and explicit
ClassLoader constructors.

Closes gh-36827

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>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add DefaultDeserializer.getClassLoader()

2 participants