File tree 1 file changed +6
-5
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -463,7 +463,7 @@ private <T> List<T> getSpringFactoriesInstances(Class<T> type) {
463
463
}
464
464
465
465
private <T > List <T > getSpringFactoriesInstances (Class <T > type , ArgumentResolver argumentResolver ) {
466
- return SpringFactoriesLoader .forDefaultResourceLocation (getClassLoader ()).load (type , argumentResolver );
466
+ return SpringFactoriesLoader .forDefaultResourceLocation (getClassLoader (null )).load (type , argumentResolver );
467
467
}
468
468
469
469
private ConfigurableEnvironment getOrCreateEnvironment () {
@@ -713,10 +713,11 @@ public ResourceLoader getResourceLoader() {
713
713
* @return a ClassLoader (never null)
714
714
*/
715
715
public ClassLoader getClassLoader () {
716
- if (this .resourceLoader != null ) {
717
- return this .resourceLoader .getClassLoader ();
718
- }
719
- return ClassUtils .getDefaultClassLoader ();
716
+ return getClassLoader (ClassUtils .getDefaultClassLoader ());
717
+ }
718
+
719
+ private ClassLoader getClassLoader (ClassLoader fallback ) {
720
+ return (this .resourceLoader != null ) ? this .resourceLoader .getClassLoader () : fallback ;
720
721
}
721
722
722
723
/**
You can’t perform that action at this time.
0 commit comments