Skip to content

adding Monetary class' class loader to ServiceLoader's load method - #333

Merged
keilw merged 1 commit into
JavaMoney:masterfrom
utkanozyurek:fix_class_loading_with_thread_class_loader_not_working
Jun 27, 2020
Merged

keilw merged 1 commit into
JavaMoney:masterfrom
utkanozyurek:fix_class_loading_with_thread_class_loader_not_working

Conversation

@utkanozyurek

@utkanozyurek utkanozyurek commented Jun 4, 2020 •

Copy link
Copy Markdown

… to fix error in Java11 parallel stream loading error


This change is Reviewable

… to fix error in Java11 parallel stream loading error
}
try{
for(T service:ServiceLoader.load(serviceType)){
for(T service:ServiceLoader.load(serviceType, Monetary.class.getClassLoader())){

@jwgmeligmeyling jwgmeligmeyling Jun 27, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if the Java Money implementation will always come from the same class loader as the API. Both classes should be resolvable from the context classloader. And yes, that may cause issues with parallel operations that are executed inside fork join pools. But won't this fix cause issues with deployments where the implementation lives in a separate module (in terms of OSGI or for example JBoss modules)? Or perhaps inside the application itself?

@keilw
keilw merged commit 671dbc2 into JavaMoney:master Jun 27, 2020
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.

3 participants