Skip to content

Commit 9c09bf8

Browse files
committed
Merge branch 'main' into 4.0.x
2 parents db3fce0 + d1ebe43 commit 9c09bf8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2025 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -463,7 +463,7 @@ private <T> List<T> getSpringFactoriesInstances(Class<T> type) {
463463
}
464464

465465
private <T> List<T> getSpringFactoriesInstances(Class<T> type, ArgumentResolver argumentResolver) {
466-
return SpringFactoriesLoader.forDefaultResourceLocation(getClassLoader(null)).load(type, argumentResolver);
466+
return SpringFactoriesLoader.forDefaultResourceLocation(getClassLoader()).load(type, argumentResolver);
467467
}
468468

469469
private ConfigurableEnvironment getOrCreateEnvironment() {
@@ -713,11 +713,10 @@ public ResourceLoader getResourceLoader() {
713713
* @return a ClassLoader (never null)
714714
*/
715715
public ClassLoader getClassLoader() {
716-
return getClassLoader(ClassUtils.getDefaultClassLoader());
717-
}
718-
719-
private ClassLoader getClassLoader(ClassLoader fallback) {
720-
return (this.resourceLoader != null) ? this.resourceLoader.getClassLoader() : fallback;
716+
if (this.resourceLoader != null) {
717+
return this.resourceLoader.getClassLoader();
718+
}
719+
return ClassUtils.getDefaultClassLoader();
721720
}
722721

723722
/**

0 commit comments

Comments
 (0)