Browse Source

Merge branch '6.2.x'

pull/34873/head
Sam Brannen 9 months ago
parent
commit
dbaba3d88a
  1. 18
      spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java
  2. 8
      spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java
  3. 16
      spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java
  4. 6
      spring-core/src/main/java/org/springframework/core/io/support/PropertiesLoaderSupport.java

18
spring-core/src/main/java/org/springframework/core/env/AbstractEnvironment.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 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.
@ -42,7 +42,7 @@ import org.springframework.util.StringUtils; @@ -42,7 +42,7 @@ import org.springframework.util.StringUtils;
* add by default. {@code AbstractEnvironment} adds none. Subclasses should contribute
* property sources through the protected {@link #customizePropertySources(MutablePropertySources)}
* hook, while clients should customize using {@link ConfigurableEnvironment#getPropertySources()}
* and working against the {@link MutablePropertySources} API.
* and work against the {@link MutablePropertySources} API.
* See {@link ConfigurableEnvironment} javadoc for usage examples.
*
* @author Chris Beams
@ -66,7 +66,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -66,7 +66,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
public static final String IGNORE_GETENV_PROPERTY_NAME = "spring.getenv.ignore";
/**
* Name of the property to set to specify active profiles: {@value}.
* Name of the property to specify active profiles: {@value}.
* <p>The value may be comma delimited.
* <p>Note that certain shell environments such as Bash disallow the use of the period
* character in variable names. Assuming that Spring's {@link SystemEnvironmentPropertySource}
@ -77,7 +77,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -77,7 +77,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
public static final String ACTIVE_PROFILES_PROPERTY_NAME = "spring.profiles.active";
/**
* Name of the property to set to specify profiles that are active by default: {@value}.
* Name of the property to specify profiles that are active by default: {@value}.
* <p>The value may be comma delimited.
* <p>Note that certain shell environments such as Bash disallow the use of the period
* character in variable names. Assuming that Spring's {@link SystemEnvironmentPropertySource}
@ -141,7 +141,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -141,7 +141,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
/**
* Factory method used to create the {@link ConfigurablePropertyResolver}
* instance used by the Environment.
* used by this {@code Environment}.
* @since 5.3.4
* @see #getPropertyResolver()
*/
@ -150,8 +150,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -150,8 +150,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
}
/**
* Return the {@link ConfigurablePropertyResolver} being used by the
* {@link Environment}.
* Return the {@link ConfigurablePropertyResolver} used by the {@code Environment}.
* @since 5.3.4
* @see #createPropertyResolver(MutablePropertySources)
*/
@ -319,7 +318,6 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -319,7 +318,6 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
}
}
@Override
public String[] getDefaultProfiles() {
return StringUtils.toStringArray(doGetDefaultProfiles());
@ -327,7 +325,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -327,7 +325,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
/**
* Return the set of default profiles explicitly set via
* {@link #setDefaultProfiles(String...)} or if the current set of default profiles
* {@link #setDefaultProfiles(String...)}, or if the current set of default profiles
* consists only of {@linkplain #getReservedDefaultProfiles() reserved default
* profiles}, then check for the presence of {@link #doGetActiveProfilesProperty()}
* and assign its value (if any) to the set of default profiles.
@ -418,7 +416,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -418,7 +416,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
* active or default profiles.
* <p>Subclasses may override to impose further restrictions on profile syntax.
* @throws IllegalArgumentException if the profile is null, empty, whitespace-only or
* begins with the profile NOT operator (!).
* begins with the profile NOT operator (!)
* @see #acceptsProfiles
* @see #addActiveProfile
* @see #setDefaultProfiles

8
spring-core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java vendored

@ -1,5 +1,5 @@ @@ -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.
@ -137,13 +137,13 @@ public interface ConfigurableEnvironment extends Environment, ConfigurableProper @@ -137,13 +137,13 @@ public interface ConfigurableEnvironment extends Environment, ConfigurableProper
Map<String, Object> getSystemEnvironment();
/**
* Append the given parent environment's active profiles, default profiles and
* Append the given parent environment's active profiles, default profiles, and
* property sources to this (child) environment's respective collections of each.
* <p>For any identically-named {@code PropertySource} instance existing in both
* parent and child, the child instance is to be preserved and the parent instance
* discarded. This has the effect of allowing overriding of property sources by the
* child as well as avoiding redundant searches through common property source types,
* for example, system environment and system properties.
* child as well as avoiding redundant searches through common property source types
* &mdash; for example, system environment and system properties.
* <p>Active and default profile names are also filtered for duplicates, to avoid
* confusion and redundant storage.
* <p>The parent environment remains unmodified in any case. Note that any changes to

16
spring-core/src/main/java/org/springframework/core/env/ConfigurablePropertyResolver.java vendored

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 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.
@ -70,21 +70,23 @@ public interface ConfigurablePropertyResolver extends PropertyResolver { @@ -70,21 +70,23 @@ public interface ConfigurablePropertyResolver extends PropertyResolver {
void setPlaceholderSuffix(String placeholderSuffix);
/**
* Specify the separating character between the placeholders replaced by this
* resolver and their associated default value, or {@code null} if no such
* Set the separating character to be honored between placeholders replaced by
* this resolver and their associated default values, or {@code null} if no such
* special character should be processed as a value separator.
*/
void setValueSeparator(@Nullable String valueSeparator);
/**
* Specify the escape character to use to ignore placeholder prefix or
* value separator, or {@code null} if no escaping should take place.
* Set the escape character to use to ignore the
* {@linkplain #setPlaceholderPrefix(String) placeholder prefix} and the
* {@linkplain #setValueSeparator(String) value separator}, or {@code null}
* if no escaping should take place.
* @since 6.2
*/
void setEscapeCharacter(@Nullable Character escapeCharacter);
/**
* Set whether to throw an exception when encountering an unresolvable placeholder
* Specify whether to throw an exception when encountering an unresolvable placeholder
* nested within the value of a given property. A {@code false} value indicates strict
* resolution, i.e. that an exception will be thrown. A {@code true} value indicates
* that unresolvable nested placeholders should be passed through in their unresolved
@ -107,7 +109,7 @@ public interface ConfigurablePropertyResolver extends PropertyResolver { @@ -107,7 +109,7 @@ public interface ConfigurablePropertyResolver extends PropertyResolver {
* {@link #setRequiredProperties} is present and resolves to a
* non-{@code null} value.
* @throws MissingRequiredPropertiesException if any of the required
* properties are not resolvable.
* properties are not resolvable
*/
void validateRequiredProperties() throws MissingRequiredPropertiesException;

6
spring-core/src/main/java/org/springframework/core/io/support/PropertiesLoaderSupport.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 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.
@ -138,8 +138,8 @@ public abstract class PropertiesLoaderSupport { @@ -138,8 +138,8 @@ public abstract class PropertiesLoaderSupport {
/**
* Return a merged Properties instance containing both the
* loaded properties and properties set on this FactoryBean.
* Return a merged {@link Properties} instance containing both the
* loaded properties and properties set on this component.
*/
protected Properties mergeProperties() throws IOException {
Properties result = new Properties();

Loading…
Cancel
Save