Browse Source

Merge branch '3.3.x' into 3.4.x

See gh-44448
pull/44535/head
Andy Wilkinson 11 months ago
parent
commit
cbf9cb04b4
  1. BIN
      gradle/wrapper/gradle-wrapper.jar
  2. 2
      gradle/wrapper/gradle-wrapper.properties
  3. 2
      gradlew
  4. 8
      spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/ImportCandidates.java
  5. 3
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/annotation/ImportCandidatesTests.java

BIN
gradle/wrapper/gradle-wrapper.jar vendored

Binary file not shown.

2
gradle/wrapper/gradle-wrapper.properties vendored

@ -1,6 +1,6 @@ @@ -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

@ -205,7 +205,7 @@ fi @@ -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.

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

@ -1,5 +1,5 @@ @@ -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; @@ -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> { @@ -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> { @@ -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;
}

3
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/annotation/ImportCandidatesTests.java

@ -47,7 +47,8 @@ class ImportCandidatesTests { @@ -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");
}

Loading…
Cancel
Save