Repository navigation
Fall back to the library class loader for classpath resources - #1265
Conversation
In OSGi runtimes the thread context class loader cannot see this library's bundled meta-schemas, so resolution fails with FileNotFoundException: classpath:draft/2020-12/schema. The 1.x ClasspathURLStreamHandler chained class loaders; the chain was not carried over in the schema retrieval refactor (#931). The fallback runs only after the TCCL misses, so flat classpath behavior is unchanged, and it is skipped when a custom class loader source is supplied.
|
No blocking findings. Risk: Medium-low. The code change is tiny, but ClasspathResourceLoader#getResource sits under schema loading and $ref/meta-schema resolution. GitNexus shows direct callers in Coverage looks good for the intended behavior:
Areas to improve, non-blocking:
|
|
It appears that PR #1265 contains the exact same code changes as PR #1266 (both modifying Since the codebase changes are identical, my previous review applies in its entirety to this PR as well. To summarize:
Status: Approved / LGTM (Looks Good To Me). You can safely merge whichever of the two PRs (#1265 or #1266) targets the branch you intend to update, and close the other as a duplicate! |
Closes #1264
Retries with the library's own class loader after the thread context class loader misses. The TCCL still wins on a hit; a custom class loader source is never overridden. The test covers the fallback, TCCL precedence, and custom-source passthrough with stub class loaders — no new test dependencies. (Also verified in an embedded Felix framework; that harness is not committed.)