DerekYRC / DerekYRC/mini-spring
AbstractAutowireCapableBeanFactory#doCreateBean 调用 getSingleton不理解
- Dominant language
- Java
- Stars
- 6.4k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
原代码是
`if (beanDefinition.isSingleton()) {
//如果有代理对象,此处获取代理对象
exposedObject = getSingleton(beanName);
addSingleton(beanName, exposedObject);
}`
spring已经在 initializeBean后 bean 不是已经被替换为 代理对象了吗,如果这里再调用getSingleton 方法,就会再生成一个新的代理对象。这段逻辑不理解
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with AbstractAutowireCapableBeanFactory#doCreateBean and trace initializeBean, getSingleton, and addSingleton to assess the reported concern about creating a second proxy. The issue names no failing test or agreed change; first establish whether this is a defect or a request for explanation. Completion requires resolving that distinction and confirming the expected singleton proxy behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100