Skip to content

Commit 18756c0

Browse files
committed
Merge branch '6.2.x'
2 parents 33aeb6e + e34cdc2 commit 18756c0

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.springframework.beans.factory.BeanFactoryAware;
2424
import org.springframework.beans.factory.BeanNameAware;
2525
import org.springframework.util.StringValueResolver;
26+
import org.springframework.util.SystemPropertyUtils;
2627

2728
/**
2829
* Abstract base class for property resource configurers that resolve placeholders
@@ -93,16 +94,16 @@ public abstract class PlaceholderConfigurerSupport extends PropertyResourceConfi
9394
implements BeanNameAware, BeanFactoryAware {
9495

9596
/** Default placeholder prefix: {@value}. */
96-
public static final String DEFAULT_PLACEHOLDER_PREFIX = "${";
97+
public static final String DEFAULT_PLACEHOLDER_PREFIX = SystemPropertyUtils.PLACEHOLDER_PREFIX;
9798

9899
/** Default placeholder suffix: {@value}. */
99-
public static final String DEFAULT_PLACEHOLDER_SUFFIX = "}";
100+
public static final String DEFAULT_PLACEHOLDER_SUFFIX = SystemPropertyUtils.PLACEHOLDER_SUFFIX;
100101

101102
/** Default value separator: {@value}. */
102-
public static final String DEFAULT_VALUE_SEPARATOR = ":";
103+
public static final String DEFAULT_VALUE_SEPARATOR = SystemPropertyUtils.VALUE_SEPARATOR;
103104

104105
/** Default escape character: {@code '\'}. */
105-
public static final Character DEFAULT_ESCAPE_CHARACTER = '\\';
106+
public static final Character DEFAULT_ESCAPE_CHARACTER = SystemPropertyUtils.ESCAPE_CHARACTER;
106107

107108

108109
/** Defaults to {@value #DEFAULT_PLACEHOLDER_PREFIX}. */
@@ -155,9 +156,10 @@ public void setValueSeparator(@Nullable String valueSeparator) {
155156
}
156157

157158
/**
158-
* Specify the escape character to use to ignore the placeholder prefix or
159-
* value separator, or {@code null} if no escaping should take place.
160-
* <p>Default is {@link #DEFAULT_ESCAPE_CHARACTER}.
159+
* Set the escape character to use to ignore the
160+
* {@linkplain #setPlaceholderPrefix(String) placeholder prefix} and the
161+
* {@linkplain #setValueSeparator(String) value separator}, or {@code null}
162+
* if no escaping should take place.
161163
* @since 6.2
162164
*/
163165
public void setEscapeCharacter(@Nullable Character escapeCharacter) {

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

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ public void setConversionService(ConfigurableConversionService conversionService
8686
}
8787

8888
/**
89-
* Set the prefix that placeholders replaced by this resolver must begin with.
90-
* <p>The default is "${".
91-
* @see org.springframework.util.SystemPropertyUtils#PLACEHOLDER_PREFIX
89+
* {@inheritDoc}
90+
* <p>The default is <code>"${"</code>.
91+
* @see SystemPropertyUtils#PLACEHOLDER_PREFIX
9292
*/
9393
@Override
9494
public void setPlaceholderPrefix(String placeholderPrefix) {
@@ -97,9 +97,9 @@ public void setPlaceholderPrefix(String placeholderPrefix) {
9797
}
9898

9999
/**
100-
* Set the suffix that placeholders replaced by this resolver must end with.
101-
* <p>The default is "}".
102-
* @see org.springframework.util.SystemPropertyUtils#PLACEHOLDER_SUFFIX
100+
* {@inheritDoc}
101+
* <p>The default is <code>"}"</code>.
102+
* @see SystemPropertyUtils#PLACEHOLDER_SUFFIX
103103
*/
104104
@Override
105105
public void setPlaceholderSuffix(String placeholderSuffix) {
@@ -108,24 +108,20 @@ public void setPlaceholderSuffix(String placeholderSuffix) {
108108
}
109109

110110
/**
111-
* Specify the separating character between the placeholders replaced by this
112-
* resolver and their associated default value, or {@code null} if no such
113-
* special character should be processed as a value separator.
114-
* <p>The default is ":".
115-
* @see org.springframework.util.SystemPropertyUtils#VALUE_SEPARATOR
111+
* {@inheritDoc}
112+
* <p>The default is {@code ":"}.
113+
* @see SystemPropertyUtils#VALUE_SEPARATOR
116114
*/
117115
@Override
118116
public void setValueSeparator(@Nullable String valueSeparator) {
119117
this.valueSeparator = valueSeparator;
120118
}
121119

122120
/**
123-
* Specify the escape character to use to ignore placeholder prefix
124-
* or value separator, or {@code null} if no escaping should take
125-
* place.
126-
* <p>The default is '\'.
121+
* {@inheritDoc}
122+
* <p>The default is {@code '\'}.
127123
* @since 6.2
128-
* @see org.springframework.util.SystemPropertyUtils#ESCAPE_CHARACTER
124+
* @see SystemPropertyUtils#ESCAPE_CHARACTER
129125
*/
130126
@Override
131127
public void setEscapeCharacter(@Nullable Character escapeCharacter) {

spring-core/src/main/java/org/springframework/util/SystemPropertyUtils.java

Lines changed: 8 additions & 5 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.
@@ -35,16 +35,19 @@
3535
*/
3636
public abstract class SystemPropertyUtils {
3737

38-
/** Prefix for system property placeholders: {@value}. */
38+
/** Prefix for property placeholders: {@value}. */
3939
public static final String PLACEHOLDER_PREFIX = "${";
4040

41-
/** Suffix for system property placeholders: {@value}. */
41+
/** Suffix for property placeholders: {@value}. */
4242
public static final String PLACEHOLDER_SUFFIX = "}";
4343

44-
/** Value separator for system property placeholders: {@value}. */
44+
/** Value separator for property placeholders: {@value}. */
4545
public static final String VALUE_SEPARATOR = ":";
4646

47-
/** Default escape character: {@code '\'}. */
47+
/**
48+
* Escape character for property placeholders: {@code '\'}.
49+
* @since 6.2
50+
*/
4851
public static final Character ESCAPE_CHARACTER = '\\';
4952

5053

0 commit comments

Comments
 (0)