dubbo.properties占位符表达式不支持默认值
- Dominant language
- Java
- Stars
- 41.6k
- Forks
- 26.4k
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 4
Description
- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
### Environment
* Dubbo version: 2.7.7
* Operating System version: Windows 10
* Java version: 1.8
### Steps to reproduce this issue
1. org.apache.dubbo.common.utils.ConfigUtils中的replaceProperty方法不支持默认值;
2. Run unit test always failed, **defaultA** and **defaultB** is default value.
```
@Test
public void testReplacePropertyDefault() throws Exception {
String s = ConfigUtils.replaceProperty("1${a.b.c:defaultA}2${a.b.c:defaultB}3", Collections.emptyMap());
assertEquals(s, "1defaultA2defaultB3");
}
```
Pls. provide [GitHub address] to reproduce this issue.
https://github.com/apache/dubbo/blob/d98d48914b139d6abb2139ea36e51e536713edfe/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConfigUtils.java#L186
### Expected Result
dubbo.properties 占位符表达式能够支持默认值
### Actual Result
What actually happens?
dubbo.properties占位符表达式不支持默认值
上面的单元测试运行失败:
```
Expected :1:defaultA}2:defaultB}3
Actual :1defaultA2defaultB3
```
Contributor guide
Assessment
This issue has not been assessed yet.