Skip to content

[OPENJPA-3013] Collect the candidate loaders without a MultiClassLoader - #212

Merged
cristof merged 1 commit into
masterfrom
OPENJPA-3013
Oct 11, 2026
Merged

cristof merged 1 commit into
masterfrom
OPENJPA-3013

Conversation

@rzo1

@rzo1 rzo1 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Applies @rmannibucau suggestion from #210: the candidate loaders were collected into a MultiClassLoader and unwrapped again immediately, which is a surprising use of a class loader as a container. They are now collected into a List<ClassLoader> and the array is built from it.

The container only existed to keep the protected hook that contributes the loaders, so that hook now takes a List<ClassLoader>. The MultiClassLoader overload is deprecated for removal and is no longer called — a subclass overriding it has to move to the new signature. Serialization is an internal utility and PersistentObjectInputStream is the only in-tree override; shout if you would rather keep the old hook consulted for compatibility.

No behaviour change otherwise: loader order, de-duplication, null filtering and the fallback to the stream own resolveClass are untouched, and TestSerializationClassResolving (4 tests) stays green, as does the kernel module. TestDetachedStateManager errors 10/10 both here and on unmodified master (CREATE TABLE SEC1_TAB ()), so it is pre-existing and unrelated.

The loaders to consult were collected into a MultiClassLoader and unwrapped
again, which only served to keep the protected hook that contributes them.
Collect them into a list and build the array from it instead.

The hook therefore takes a List<ClassLoader>; the MultiClassLoader overload is
deprecated for removal and no longer called, so a subclass overriding it has to
move to the new signature.
@rzo1 rzo1 self-assigned this Oct 9, 2026
@cristof
cristof merged commit ace0ff4 into master Oct 11, 2026
4 checks passed
@solomax
solomax deleted the OPENJPA-3013 branch October 12, 2026 01:46
@solomax

solomax commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

It seems I'm a bit late at the party ...
But
I would say now we have code duplication
MultiClassLoader is widely used, so it can't be dropped/deprecated
Maybe common functionality can be extracted to the static method?

@cristof

cristof commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

@solomax, sorry (again)! I thought you had approved the PR. I'll be more attentive next time.

@solomax

solomax commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

not a big deal @cristof :)
PR with 3 approvals definitely deserves to be merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants