Merge branch '3.3.x' into 3.4.x

See gh-44448
This commit is contained in:
Andy Wilkinson 2025-02-27 10:50:42 +00:00
commit cbf9cb04b4
5 changed files with 7 additions and 8 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

2
gradlew vendored
View File

@ -205,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2025 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -29,7 +29,6 @@ import java.util.List;
import org.springframework.core.io.UrlResource;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
/**
* Contains {@code @Configuration} import candidates, usually auto-configurations.
@ -74,8 +73,7 @@ public final class ImportCandidates implements Iterable<String> {
* Every line contains the full qualified name of the candidate class. Comments are
* supported using the # character.
* @param annotation annotation to load
* @param classLoader class loader to use for loading, or {@code null} to use the
* {@link ClassUtils#getDefaultClassLoader() default class loader}
* @param classLoader class loader to use for loading
* @return list of names of annotated classes
*/
public static ImportCandidates load(Class<?> annotation, ClassLoader classLoader) {
@ -93,7 +91,7 @@ public final class ImportCandidates implements Iterable<String> {
private static ClassLoader decideClassloader(ClassLoader classLoader) {
if (classLoader == null) {
return ClassUtils.getDefaultClassLoader();
return ImportCandidates.class.getClassLoader();
}
return classLoader;
}

View File

@ -47,7 +47,8 @@ class ImportCandidatesTests {
""")
void loadReadsFromClasspathFile() {
ImportCandidates candidates = ImportCandidates.load(TestAnnotation.class, null);
ImportCandidates candidates = ImportCandidates.load(TestAnnotation.class,
Thread.currentThread().getContextClassLoader());
assertThat(candidates).containsExactly("class1", "class2", "class3");
}