strongduanmu commented on a change in pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#discussion_r731772133
##########
File path:
shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-namespace-infra/src/main/java/org/apache/shardingsphere/spring/namespace/registry/ShardingSphereAlgorithmBeanRegistry.java
##########
@@ -45,8 +45,7 @@
String algorithmFactoryBeanClassName =
algorithmFactoryBeanClass.getName();
Map<String, RuntimeBeanReference> result = new
ManagedMap<>(beanDefinitionNames.length);
for (String each : beanDefinitionNames) {
- String beanClassName =
parserContext.getRegistry().getBeanDefinition(each).getBeanClassName();
- if (null != beanClassName &&
beanClassName.equals(algorithmFactoryBeanClassName)) {
+ if
(algorithmFactoryBeanClassName.equals(parserContext.getRegistry().getBeanDefinition(each).getBeanClassName()))
{
Review comment:
> @strongduanmu The code logic is no different, but the code is more
clean. Another reason is to fulfill my promise,although it has been fixed. So
it doesn’t matter if there is no approval, I will close it as soon as possible
@notzero1995 I understand what you mean, but I think the original code can
express the intent very well, and the npe has been verified.
There are other issues in the community, and you are also welcome to
contribute.
--
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]