Merge branch '6.2.x'

This commit is contained in:
Sam Brannen
2025-04-10 16:49:43 +02:00
35 changed files with 112 additions and 145 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2025 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.
@@ -59,7 +59,7 @@ public class DefaultResourceLoader implements ResourceLoader {
/**
* Create a new DefaultResourceLoader.
* <p>ClassLoader access will happen using the thread context class loader
* at the time of actual resource access (since 5.3). For more control, pass
* at the time of actual resource access. For more control, pass
* a specific ClassLoader to {@link #DefaultResourceLoader(ClassLoader)}.
* @see java.lang.Thread#getContextClassLoader()
*/
@@ -80,7 +80,7 @@ public class DefaultResourceLoader implements ResourceLoader {
* Specify the ClassLoader to load class path resources with, or {@code null}
* for using the thread context class loader at the time of actual resource access.
* <p>The default is that ClassLoader access will happen using the thread context
* class loader at the time of actual resource access (since 5.3).
* class loader at the time of actual resource access.
*/
public void setClassLoader(@Nullable ClassLoader classLoader) {
this.classLoader = classLoader;

View File

@@ -125,13 +125,12 @@ public class SpringFactoriesLoader {
* Load and instantiate the factory implementations of the given type from
* {@value #FACTORIES_RESOURCE_LOCATION}, using the configured class loader
* and a default argument resolver that expects a no-arg constructor.
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
* <p>If a custom instantiation strategy is required, use {@code load(...)}
* with a custom {@link ArgumentResolver ArgumentResolver} and/or
* {@link FailureHandler FailureHandler}.
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
* discovered for a given factory type, only one instance of the duplicated
* implementation type will be instantiated.
* <p>If duplicate implementation class names are discovered for a given factory
* type, only one instance of the duplicated implementation type will be instantiated.
* @param factoryType the interface or abstract class representing the factory
* @throws IllegalArgumentException if any factory implementation class cannot
* be loaded or if an error occurs while instantiating any factory
@@ -145,10 +144,9 @@ public class SpringFactoriesLoader {
* Load and instantiate the factory implementations of the given type from
* {@value #FACTORIES_RESOURCE_LOCATION}, using the configured class loader
* and the given argument resolver.
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
* discovered for a given factory type, only one instance of the duplicated
* implementation type will be instantiated.
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
* <p>If duplicate implementation class names are discovered for a given factory
* type, only one instance of the duplicated implementation type will be instantiated.
* @param factoryType the interface or abstract class representing the factory
* @param argumentResolver strategy used to resolve constructor arguments by their type
* @throws IllegalArgumentException if any factory implementation class cannot
@@ -163,10 +161,9 @@ public class SpringFactoriesLoader {
* Load and instantiate the factory implementations of the given type from
* {@value #FACTORIES_RESOURCE_LOCATION}, using the configured class loader
* with custom failure handling provided by the given failure handler.
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
* discovered for a given factory type, only one instance of the duplicated
* implementation type will be instantiated.
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
* <p>If duplicate implementation class names are discovered for a given factory
* type, only one instance of the duplicated implementation type will be instantiated.
* <p>For any factory implementation class that cannot be loaded or error that
* occurs while instantiating it, the given failure handler is called.
* @param factoryType the interface or abstract class representing the factory
@@ -182,10 +179,9 @@ public class SpringFactoriesLoader {
* {@value #FACTORIES_RESOURCE_LOCATION}, using the configured class loader,
* the given argument resolver, and custom failure handling provided by the given
* failure handler.
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
* discovered for a given factory type, only one instance of the duplicated
* implementation type will be instantiated.
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
* <p>If duplicate implementation class names are discovered for a given factory
* type, only one instance of the duplicated implementation type will be instantiated.
* <p>For any factory implementation class that cannot be loaded or error that
* occurs while instantiating it, the given failure handler is called.
* @param factoryType the interface or abstract class representing the factory
@@ -235,12 +231,11 @@ public class SpringFactoriesLoader {
/**
* Load and instantiate the factory implementations of the given type from
* {@value #FACTORIES_RESOURCE_LOCATION}, using the given class loader.
* <p>The returned factories are sorted through {@link AnnotationAwareOrderComparator}.
* <p>As of Spring Framework 5.3, if duplicate implementation class names are
* discovered for a given factory type, only one instance of the duplicated
* implementation type will be instantiated.
* <p>The returned factories are sorted using {@link AnnotationAwareOrderComparator}.
* <p>If duplicate implementation class names are discovered for a given factory
* type, only one instance of the duplicated implementation type will be instantiated.
* <p>For more advanced factory loading with {@link ArgumentResolver} or
* {@link FailureHandler} support use {@link #forDefaultResourceLocation(ClassLoader)}
* {@link FailureHandler} support, use {@link #forDefaultResourceLocation(ClassLoader)}
* to obtain a {@link SpringFactoriesLoader} instance.
* @param factoryType the interface or abstract class representing the factory
* @param classLoader the ClassLoader to use for loading (can be {@code null}
@@ -256,9 +251,8 @@ public class SpringFactoriesLoader {
* Load the fully qualified class names of factory implementations of the
* given type from {@value #FACTORIES_RESOURCE_LOCATION}, using the given
* class loader.
* <p>As of Spring Framework 5.3, if a particular implementation class name
* is discovered more than once for the given factory type, duplicates will
* be ignored.
* <p>If a particular implementation class name is discovered more than once
* for the given factory type, duplicates will be ignored.
* @param factoryType the interface or abstract class representing the factory
* @param classLoader the ClassLoader to use for loading resources; can be
* {@code null} to use the default

View File

@@ -103,7 +103,7 @@ public abstract class CollectionUtils {
* <p>This differs from the regular {@link LinkedHashMap} constructor
* which takes an initial capacity relative to a load factor but is
* aligned with Spring's own {@link LinkedCaseInsensitiveMap} and
* {@link LinkedMultiValueMap} constructor semantics as of 5.3.
* {@link LinkedMultiValueMap} constructor semantics.
* @param expectedSize the expected number of elements (with a corresponding
* capacity to be derived so that no resize/rehash operations are needed)
* @since 5.3

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2025 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.
@@ -35,8 +35,7 @@ import java.util.Map;
* @param <K> the key type
* @param <V> the value element type
*/
public class LinkedMultiValueMap<K, V> extends MultiValueMapAdapter<K, V> // new public base class in 5.3
implements Serializable, Cloneable {
public class LinkedMultiValueMap<K, V> extends MultiValueMapAdapter<K, V> implements Serializable, Cloneable {
private static final long serialVersionUID = 3801124242820219131L;