Skip to content

Use PyJObject ClassLoader instead of jep.forName in java import hook.#617

Merged
bsteffensmeier merged 1 commit into
ninia:dev_4.3from
bsteffensmeier:threaded-java-imports
Oct 28, 2025
Merged

Use PyJObject ClassLoader instead of jep.forName in java import hook.#617
bsteffensmeier merged 1 commit into
ninia:dev_4.3from
bsteffensmeier:threaded-java-imports

Conversation

@bsteffensmeier

Copy link
Copy Markdown
Member

This is part of my efforts to make jep more functional from java created threads. This adds a class loader to the java import hook. Since jep.forName() is calling ClassLoader.loadClass() internally using the same class loader that is used to construct the interpreter instance this change should not be changing any actual behavior of the java import hook. However since the class loader in the jep thread state is not available on python created threads and the class loader in the hook is available on those threads this will allow the hook to work on python created threads.

@bsteffensmeier bsteffensmeier merged commit ff7fdc8 into ninia:dev_4.3 Oct 28, 2025
1 check passed
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.

2 participants