DerekYRC / DerekYRC/mini-spring
属性占位符替换时,如果当前bean存在String类型的属性但是不用占位符替换,会重复添加PropertyValue
- Dominant language
- Java
- Stars
- 6.4k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
当前属为`String`类型时,会尝试使用`resolvePlaceholder`来进行占位符替换,对于直接使用`value`来指定属性值的属性不会有任何作用:

但是这里没有添加判断,导致重复添加`PropertyValue`,虽然不会影响后面bean的创建,但是属性列表有重复项也是一种**冗余**:

增加了一定的判断之后:

出现问题的代码在:
https://github.com/DerekYRC/mini-spring/blob/ef07ca1105b4c57b70d63a50425a0de6d6b5814a/src/main/java/org/springframework/beans/factory/PropertyPlaceholderConfigurer.java#L78C5-L78C88
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at src/main/java/org/springframework/beans/factory/PropertyPlaceholderConfigurer.java around line 78 and trace resolvePlaceholder and PropertyValue additions for literal String values. Done means literal values no longer produce duplicate property entries while placeholder replacement and bean creation still work. The issue names no tests and has remained unanswered for 920 days; confirm it still applies before starting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100