Skip to content

Commit 4f0dd51

Browse files
committed
Merge branch '3.3.x' into 3.4.x
Closes gh-44448
2 parents 23b89c8 + 56c9551 commit 4f0dd51

File tree

1 file changed

+5
-3
lines changed
  • spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation

1 file changed

+5
-3
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 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.
@@ -29,6 +29,7 @@
2929

3030
import org.springframework.core.io.UrlResource;
3131
import org.springframework.util.Assert;
32+
import org.springframework.util.ClassUtils;
3233

3334
/**
3435
* Contains {@code @Configuration} import candidates, usually auto-configurations.
@@ -73,7 +74,8 @@ public List<String> getCandidates() {
7374
* Every line contains the full qualified name of the candidate class. Comments are
7475
* supported using the # character.
7576
* @param annotation annotation to load
76-
* @param classLoader class loader to use for loading
77+
* @param classLoader class loader to use for loading, or {@code null} to use the
78+
* {@link ClassUtils#getDefaultClassLoader() default class loader}
7779
* @return list of names of annotated classes
7880
*/
7981
public static ImportCandidates load(Class<?> annotation, ClassLoader classLoader) {
@@ -91,7 +93,7 @@ public static ImportCandidates load(Class<?> annotation, ClassLoader classLoader
9193

9294
private static ClassLoader decideClassloader(ClassLoader classLoader) {
9395
if (classLoader == null) {
94-
return ImportCandidates.class.getClassLoader();
96+
return ClassUtils.getDefaultClassLoader();
9597
}
9698
return classLoader;
9799
}

0 commit comments

Comments
 (0)