feat: add native BoxLang 1.8.0+ dynamic class loading support#25
Conversation
When running on BoxLang 1.8.0+, bypass JavaLoader entirely and delegate to BoxLang's built-in getRequestClassLoader().addPaths() / createObject() APIs, eliminating URLClassLoader overhead and server-scope caching. - ModuleConfig: skip jl@cbjavaloader binding and cfcdynamicproxy.jar prepend on BoxLang (neither is needed with native class loading) - Loader: add isBoxLangNative() helper (cached, probed via try/catch) and BoxLang branches in setup(), create(), appendPaths(), getLoadedURLs(), getURLClassLoader(), getVersion() - LoaderTest: adjust expected URL count (1 on BoxLang, 2 on CF/Lucee) Falls back gracefully to JavaLoader on BoxLang < 1.8.0 if addPaths() is unavailable. https://claude.ai/code/session_01G5FaLgYNxWeRijMwPryJj8
Remove the try/catch version probe. BoxLang is always current so a simple server.boxlang struct key check is sufficient. https://claude.ai/code/session_01G5FaLgYNxWeRijMwPryJj8
boxlang-cfml@1 ColdBox be Test Results4 tests ±0 2 ✅ - 2 0s ⏱️ ±0s For more details on these errors, see this check. Results for commit 920c457. ± Comparison against base commit 3ec97ff. ♻️ This comment has been updated with latest results. |
boxlang@1 ColdBox be Test Results4 tests ±0 2 ✅ - 2 0s ⏱️ ±0s For more details on these errors, see this check. Results for commit 920c457. ± Comparison against base commit 3ec97ff. ♻️ This comment has been updated with latest results. |
boxlang-cfml@1 ColdBox ^7.0.0 Test Results4 tests ±0 2 ✅ - 2 0s ⏱️ ±0s For more details on these errors, see this check. Results for commit 920c457. ± Comparison against base commit 3ec97ff. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
Adds a BoxLang-native code path to cbjavaloader so BoxLang runtimes can use the built-in request class loader APIs instead of JavaLoader, while keeping the existing JavaLoader behavior for CF/Lucee.
Changes:
- Conditionalize
jl@cbjavaloaderbinding andcfcdynamicproxy.jarprepending based on BoxLang detection. - Add BoxLang-native branches in
models/Loader.cfcfor setup, class creation, path appending, and URL reporting. - Update the Loader test expectation for loaded URL count on BoxLang vs CF/Lucee.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
ModuleConfig.cfc |
Skips JavaLoader binding and dynamic-proxy jar on BoxLang runtimes. |
models/Loader.cfc |
Implements BoxLang-native class loading branches and a BoxLang detection helper. |
test-harness/tests/specs/LoaderTest.cfc |
Adjusts expected loaded URL count for BoxLang vs CF/Lucee. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ding paths Agent-Logs-Url: https://github.com/coldbox-modules/cbjavaloader/sessions/618d75fc-d52b-4f89-9293-5a5fb15482d7 Co-authored-by: lmajano <137111+lmajano@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.