You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/10/17 05:32:17 UTC

[GitHub] [shardingsphere] notzero1995 opened a new pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

notzero1995 opened a new pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073


   Sorry to push  the code so late , although it has been repaired , but I provide a new implementation
   
   
   
   Fixes #10366.
   
   Changes proposed in this pull request:
   -
   -
   -
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on a change in pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#discussion_r730600893



##########
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:
       @notzero1995 What is the difference between this logic and the original logic?




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] notzero1995 commented on a change in pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
notzero1995 commented on a change in pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#discussion_r730847348



##########
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. So it doesn’t matter if there is no approval, I will close it as soon as possible




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] notzero1995 commented on a change in pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
notzero1995 commented on a change in pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#discussion_r730847348



##########
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 make up for my promise. So it doesn’t matter if there is no approval, I will close it as soon as possible




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] notzero1995 commented on a change in pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
notzero1995 commented on a change in pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#discussion_r730847348



##########
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:
       The code logic is no different, but the code is more clean. Another reason is to make up for my promise. So it doesn’t matter if there is no approval, I will close it as soon as possible




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] notzero1995 closed pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
notzero1995 closed pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] notzero1995 commented on a change in pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
notzero1995 commented on a change in pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#discussion_r731808574



##########
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:
       
   thank , I will close issues and pull requests, and I will pay attention to other issues




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
tristaZero commented on pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#issuecomment-945054879


   Hi @notzero1995 anyway, glad to see you come back.
   @strongduanmu  or @TeslaCN could you have a review here?


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] notzero1995 commented on a change in pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
notzero1995 commented on a change in pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#discussion_r730847348



##########
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  for my promise. So it doesn’t matter if there is no approval, I will close it as soon as possible




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] notzero1995 commented on a change in pull request #13073: Think of it a different way to solve BeanDefinition is the abstract c…

Posted by GitBox <gi...@apache.org>.
notzero1995 commented on a change in pull request #13073:
URL: https://github.com/apache/shardingsphere/pull/13073#discussion_r730847348



##########
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




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org