Skip to content

Commit

Permalink
Instantiate detectors with ClassLoader that discovered them
Browse files Browse the repository at this point in the history
Fixes gh-27422
  • Loading branch information
wilkinsona committed Jul 21, 2021
1 parent dfe91be commit 29c83bf
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -162,7 +162,7 @@ private <T> List<T> getDetectors(ConfigurableListableBeanFactory beanFactory, Cl
List<String> names = SpringFactoriesLoader.loadFactoryNames(type, beanFactory.getBeanClassLoader());
Instantiator<T> instantiator = new Instantiator<>(type,
(availableParameters) -> availableParameters.add(Environment.class, this.environment));
return instantiator.instantiate(names);
return instantiator.instantiate(beanFactory.getBeanClassLoader(), names);
}

private static BeanDefinition getBeanDefinition(String beanName, ConfigurableListableBeanFactory beanFactory) {
Expand Down

0 comments on commit 29c83bf

Please sign in to comment.