kang-hl commented on code in PR #12834:
URL: https://github.com/apache/dubbo/pull/12834#discussion_r1283913393
##########
dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/context/DubboSpringInitializer.java:
##########
@@ -68,14 +68,15 @@ public static boolean remove(BeanDefinitionRegistry
registry) {
}
public static boolean remove(ApplicationContext springContext) {
+ AutowireCapableBeanFactory autowireCapableBeanFactory =
springContext.getAutowireCapableBeanFactory();
for (Map.Entry<BeanDefinitionRegistry, DubboSpringInitContext> entry :
contextMap.entrySet()) {
DubboSpringInitContext initContext = entry.getValue();
if (initContext.getApplicationContext() == springContext ||
- initContext.getBeanFactory() ==
springContext.getAutowireCapableBeanFactory() ||
- initContext.getRegistry() ==
springContext.getAutowireCapableBeanFactory()
+ initContext.getBeanFactory() == autowireCapableBeanFactory ||
+ initContext.getRegistry() == autowireCapableBeanFactory
) {
DubboSpringInitContext context =
contextMap.remove(entry.getKey());
- logger.info("Unbind " +
safeGetModelDesc(context.getModuleModel()) + " from spring container: " +
+ logger.info("Unbind " + context.getModuleModel().getDesc() + "
from spring container: " +
Review Comment:
> Is it possible throws NPE here?
The initContext method ensures that the context.getModuleMode() does not
return null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]