Skip to content

Commit 45a2c51

Browse files
committed
Polish Javadoc for Environment-related components
1 parent b98c325 commit 45a2c51

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-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.
@@ -42,7 +42,7 @@
4242
* add by default. {@code AbstractEnvironment} adds none. Subclasses should contribute
4343
* property sources through the protected {@link #customizePropertySources(MutablePropertySources)}
4444
* hook, while clients should customize using {@link ConfigurableEnvironment#getPropertySources()}
45-
* and working against the {@link MutablePropertySources} API.
45+
* and work against the {@link MutablePropertySources} API.
4646
* See {@link ConfigurableEnvironment} javadoc for usage examples.
4747
*
4848
* @author Chris Beams
@@ -66,7 +66,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
6666
public static final String IGNORE_GETENV_PROPERTY_NAME = "spring.getenv.ignore";
6767

6868
/**
69-
* Name of the property to set to specify active profiles: {@value}.
69+
* Name of the property to specify active profiles: {@value}.
7070
* <p>The value may be comma delimited.
7171
* <p>Note that certain shell environments such as Bash disallow the use of the period
7272
* character in variable names. Assuming that Spring's {@link SystemEnvironmentPropertySource}
@@ -77,7 +77,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
7777
public static final String ACTIVE_PROFILES_PROPERTY_NAME = "spring.profiles.active";
7878

7979
/**
80-
* Name of the property to set to specify profiles that are active by default: {@value}.
80+
* Name of the property to specify profiles that are active by default: {@value}.
8181
* <p>The value may be comma delimited.
8282
* <p>Note that certain shell environments such as Bash disallow the use of the period
8383
* character in variable names. Assuming that Spring's {@link SystemEnvironmentPropertySource}
@@ -141,7 +141,7 @@ protected AbstractEnvironment(MutablePropertySources propertySources) {
141141

142142
/**
143143
* Factory method used to create the {@link ConfigurablePropertyResolver}
144-
* instance used by the Environment.
144+
* used by this {@code Environment}.
145145
* @since 5.3.4
146146
* @see #getPropertyResolver()
147147
*/
@@ -150,8 +150,7 @@ protected ConfigurablePropertyResolver createPropertyResolver(MutablePropertySou
150150
}
151151

152152
/**
153-
* Return the {@link ConfigurablePropertyResolver} being used by the
154-
* {@link Environment}.
153+
* Return the {@link ConfigurablePropertyResolver} used by the {@code Environment}.
155154
* @since 5.3.4
156155
* @see #createPropertyResolver(MutablePropertySources)
157156
*/
@@ -320,15 +319,14 @@ public void addActiveProfile(String profile) {
320319
}
321320
}
322321

323-
324322
@Override
325323
public String[] getDefaultProfiles() {
326324
return StringUtils.toStringArray(doGetDefaultProfiles());
327325
}
328326

329327
/**
330328
* Return the set of default profiles explicitly set via
331-
* {@link #setDefaultProfiles(String...)} or if the current set of default profiles
329+
* {@link #setDefaultProfiles(String...)}, or if the current set of default profiles
332330
* consists only of {@linkplain #getReservedDefaultProfiles() reserved default
333331
* profiles}, then check for the presence of {@link #doGetActiveProfilesProperty()}
334332
* and assign its value (if any) to the set of default profiles.
@@ -420,7 +418,7 @@ protected boolean isProfileActive(String profile) {
420418
* active or default profiles.
421419
* <p>Subclasses may override to impose further restrictions on profile syntax.
422420
* @throws IllegalArgumentException if the profile is null, empty, whitespace-only or
423-
* begins with the profile NOT operator (!).
421+
* begins with the profile NOT operator (!)
424422
* @see #acceptsProfiles
425423
* @see #addActiveProfile
426424
* @see #setDefaultProfiles

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-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.
@@ -137,13 +137,13 @@ public interface ConfigurableEnvironment extends Environment, ConfigurableProper
137137
Map<String, Object> getSystemEnvironment();
138138

139139
/**
140-
* Append the given parent environment's active profiles, default profiles and
140+
* Append the given parent environment's active profiles, default profiles, and
141141
* property sources to this (child) environment's respective collections of each.
142142
* <p>For any identically-named {@code PropertySource} instance existing in both
143143
* parent and child, the child instance is to be preserved and the parent instance
144144
* discarded. This has the effect of allowing overriding of property sources by the
145-
* child as well as avoiding redundant searches through common property source types,
146-
* for example, system environment and system properties.
145+
* child as well as avoiding redundant searches through common property source types
146+
* &mdash; for example, system environment and system properties.
147147
* <p>Active and default profile names are also filtered for duplicates, to avoid
148148
* confusion and redundant storage.
149149
* <p>The parent environment remains unmodified in any case. Note that any changes to

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-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.
@@ -69,21 +69,23 @@ public interface ConfigurablePropertyResolver extends PropertyResolver {
6969
void setPlaceholderSuffix(String placeholderSuffix);
7070

7171
/**
72-
* Specify the separating character between the placeholders replaced by this
73-
* resolver and their associated default value, or {@code null} if no such
72+
* Set the separating character to be honored between placeholders replaced by
73+
* this resolver and their associated default values, or {@code null} if no such
7474
* special character should be processed as a value separator.
7575
*/
7676
void setValueSeparator(@Nullable String valueSeparator);
7777

7878
/**
79-
* Specify the escape character to use to ignore placeholder prefix or
80-
* value separator, or {@code null} if no escaping should take place.
79+
* Set the escape character to use to ignore the
80+
* {@linkplain #setPlaceholderPrefix(String) placeholder prefix} and the
81+
* {@linkplain #setValueSeparator(String) value separator}, or {@code null}
82+
* if no escaping should take place.
8183
* @since 6.2
8284
*/
8385
void setEscapeCharacter(@Nullable Character escapeCharacter);
8486

8587
/**
86-
* Set whether to throw an exception when encountering an unresolvable placeholder
88+
* Specify whether to throw an exception when encountering an unresolvable placeholder
8789
* nested within the value of a given property. A {@code false} value indicates strict
8890
* resolution, i.e. that an exception will be thrown. A {@code true} value indicates
8991
* that unresolvable nested placeholders should be passed through in their unresolved
@@ -106,7 +108,7 @@ public interface ConfigurablePropertyResolver extends PropertyResolver {
106108
* {@link #setRequiredProperties} is present and resolves to a
107109
* non-{@code null} value.
108110
* @throws MissingRequiredPropertiesException if any of the required
109-
* properties are not resolvable.
111+
* properties are not resolvable
110112
*/
111113
void validateRequiredProperties() throws MissingRequiredPropertiesException;
112114

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-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.
@@ -141,8 +141,8 @@ public void setPropertiesPersister(@Nullable PropertiesPersister propertiesPersi
141141

142142

143143
/**
144-
* Return a merged Properties instance containing both the
145-
* loaded properties and properties set on this FactoryBean.
144+
* Return a merged {@link Properties} instance containing both the
145+
* loaded properties and properties set on this component.
146146
*/
147147
protected Properties mergeProperties() throws IOException {
148148
Properties result = new Properties();

0 commit comments

Comments
 (0)