You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2020/06/13 05:12:25 UTC

[shardingsphere] branch master updated: Remove useless attributes from AlgorithmFactoryBean (#6023)

This is an automated email from the ASF dual-hosted git repository.

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 657c7ed  Remove useless attributes from AlgorithmFactoryBean (#6023)
657c7ed is described below

commit 657c7edea34b753e94a225e40d219de57a897107
Author: Liang Zhang <te...@163.com>
AuthorDate: Sat Jun 13 13:12:13 2020 +0800

    Remove useless attributes from AlgorithmFactoryBean (#6023)
    
    * Remove id ref from EncryptAlgorithmFactoryBean
    
    * Remove id ref from MasterSlaveLoadBalanceAlgorithmFactoryBean
---
 .../spring/namespace/factorybean/EncryptAlgorithmFactoryBean.java     | 4 ----
 .../spring/namespace/parser/EncryptAlgorithmBeanDefinitionParser.java | 1 -
 .../spring/namespace/tag/EncryptAlgorithmBeanDefinitionTag.java       | 2 --
 .../factorybean/MasterSlaveLoadBalanceAlgorithmFactoryBean.java       | 4 ----
 .../parser/MasterSlaveLoadBalanceAlgorithmBeanDefinitionParser.java   | 1 -
 .../spring/namespace/tag/LoadBalanceAlgorithmBeanDefinitionTag.java   | 2 --
 .../spring/namespace/factorybean/KeyGenerateAlgorithmFactoryBean.java | 2 --
 .../spring/namespace/factorybean/ShardingAlgorithmFactoryBean.java    | 4 +---
 8 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/factorybean/EncryptAlgorithmFactoryBean.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/factorybean/EncryptAlgorithmFactoryBean.java
index 25e249e..3707c12 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/factorybean/EncryptAlgorithmFactoryBean.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/factorybean/EncryptAlgorithmFactoryBean.java
@@ -17,7 +17,6 @@
 
 package org.apache.shardingsphere.encrypt.spring.namespace.factorybean;
 
-import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
 import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
@@ -30,15 +29,12 @@ import java.util.Properties;
  * Encrypt algorithm factory bean.
  */
 @RequiredArgsConstructor
-@Getter
 public final class EncryptAlgorithmFactoryBean implements FactoryBean<EncryptAlgorithm> {
     
     static {
         ShardingSphereServiceLoader.register(EncryptAlgorithm.class);
     }
     
-    private final String id;
-    
     private final String type;
     
     private final Properties props;
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/parser/EncryptAlgorithmBeanDefinitionParser.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/parser/EncryptAlgorithmBeanDefinitionParser.java
index 9f9ba05..9c2bb01 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/parser/EncryptAlgorithmBeanDefinitionParser.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/parser/EncryptAlgorithmBeanDefinitionParser.java
@@ -36,7 +36,6 @@ public final class EncryptAlgorithmBeanDefinitionParser extends AbstractBeanDefi
     @Override
     protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) {
         BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(EncryptAlgorithmFactoryBean.class);
-        factory.addConstructorArgValue(element.getAttribute(EncryptAlgorithmBeanDefinitionTag.ID_ATTRIBUTE));
         factory.addConstructorArgValue(element.getAttribute(EncryptAlgorithmBeanDefinitionTag.TYPE_ATTRIBUTE));
         factory.addConstructorArgValue(parseProperties(element, parserContext));
         return factory.getBeanDefinition();
diff --git a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/tag/EncryptAlgorithmBeanDefinitionTag.java b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/tag/EncryptAlgorithmBeanDefinitionTag.java
index 8842fe6..2082dd1 100644
--- a/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/tag/EncryptAlgorithmBeanDefinitionTag.java
+++ b/shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-spring/shardingsphere-encrypt-spring-namespace/src/main/java/org/apache/shardingsphere/encrypt/spring/namespace/tag/EncryptAlgorithmBeanDefinitionTag.java
@@ -24,8 +24,6 @@ public final class EncryptAlgorithmBeanDefinitionTag {
     
     public static final String ROOT_TAG = "encrypt-algorithm";
     
-    public static final String ID_ATTRIBUTE = "id";
-    
     public static final String TYPE_ATTRIBUTE = "type";
     
     public static final String PROPS_TAG = "props";
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/factorybean/MasterSlaveLoadBalanceAlgorithmFactoryBean.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/factorybean/Mast [...]
index fd31a35..24069df 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/factorybean/MasterSlaveLoadBalanceAlgorithmFactoryBean.java
+++ b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/factorybean/MasterSlaveLoadBalanceAlgorithmFactoryBean.java
@@ -17,7 +17,6 @@
 
 package org.apache.shardingsphere.masterslave.spring.namespace.factorybean;
 
-import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
 import org.apache.shardingsphere.infra.spi.type.TypedSPIRegistry;
@@ -30,15 +29,12 @@ import java.util.Properties;
  * Master-slave load balance algorithm factory bean.
  */
 @RequiredArgsConstructor
-@Getter
 public final class MasterSlaveLoadBalanceAlgorithmFactoryBean implements FactoryBean<MasterSlaveLoadBalanceAlgorithm> {
     
     static {
         ShardingSphereServiceLoader.register(MasterSlaveLoadBalanceAlgorithm.class);
     }
     
-    private final String id;
-    
     private final String type;
     
     private final Properties props;
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/parser/MasterSlaveLoadBalanceAlgorithmBeanDefinitionParser.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/parser/Maste [...]
index 61a59a7..2dbb4de 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/parser/MasterSlaveLoadBalanceAlgorithmBeanDefinitionParser.java
+++ b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/parser/MasterSlaveLoadBalanceAlgorithmBeanDefinitionParser.java
@@ -36,7 +36,6 @@ public final class MasterSlaveLoadBalanceAlgorithmBeanDefinitionParser extends A
     @Override
     protected AbstractBeanDefinition parseInternal(final Element element, final ParserContext parserContext) {
         BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(MasterSlaveLoadBalanceAlgorithmFactoryBean.class);
-        factory.addConstructorArgValue(element.getAttribute(LoadBalanceAlgorithmBeanDefinitionTag.ID_ATTRIBUTE));
         factory.addConstructorArgValue(element.getAttribute(LoadBalanceAlgorithmBeanDefinitionTag.TYPE_ATTRIBUTE));
         factory.addConstructorArgValue(parseProperties(element, parserContext));
         return factory.getBeanDefinition();
diff --git a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/LoadBalanceAlgorithmBeanDefinitionTag.java b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/LoadBalanceAlgorithmBeanD [...]
index 1a662f0..cc9a7a9 100644
--- a/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/LoadBalanceAlgorithmBeanDefinitionTag.java
+++ b/shardingsphere-features/shardingsphere-master-slave/shardingsphere-master-slave-spring/shardingsphere-master-slave-spring-namespace/src/main/java/org/apache/shardingsphere/masterslave/spring/namespace/tag/LoadBalanceAlgorithmBeanDefinitionTag.java
@@ -24,8 +24,6 @@ public final class LoadBalanceAlgorithmBeanDefinitionTag {
     
     public static final String ROOT_TAG = "load-balance-algorithm";
     
-    public static final String ID_ATTRIBUTE = "id";
-    
     public static final String TYPE_ATTRIBUTE = "type";
     
     public static final String PROPS_TAG = "properties";
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/factorybean/KeyGenerateAlgorithmFactoryBean.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/factorybean/KeyGenerateAlgorithmFactoryBean.java
index 97c2434..a5666b7 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/factorybean/KeyGenerateAlgorithmFactoryBean.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/factorybean/KeyGenerateAlgorithmFactoryBean.java
@@ -19,7 +19,6 @@ package org.apache.shardingsphere.sharding.spring.namespace.factorybean;
 
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
-import lombok.Getter;
 import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
 import org.apache.shardingsphere.infra.spi.type.TypedSPIRegistry;
 import org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm;
@@ -30,7 +29,6 @@ import java.util.Properties;
 /**
  * Key generate algorithm factory bean.
  */
-@Getter
 public final class KeyGenerateAlgorithmFactoryBean implements FactoryBean<KeyGenerateAlgorithm> {
     
     static {
diff --git a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/factorybean/ShardingAlgorithmFactoryBean.java b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/factorybean/ShardingAlgorithmFactoryBean.java
index 7ae768e..757b147 100644
--- a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/factorybean/ShardingAlgorithmFactoryBean.java
+++ b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-spring/shardingsphere-sharding-spring-namespace/src/main/java/org/apache/shardingsphere/sharding/spring/namespace/factorybean/ShardingAlgorithmFactoryBean.java
@@ -19,10 +19,9 @@ package org.apache.shardingsphere.sharding.spring.namespace.factorybean;
 
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
-import lombok.Getter;
 import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
-import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
 import org.apache.shardingsphere.infra.spi.type.TypedSPIRegistry;
+import org.apache.shardingsphere.sharding.spi.ShardingAlgorithm;
 import org.springframework.beans.factory.FactoryBean;
 
 import java.util.Properties;
@@ -30,7 +29,6 @@ import java.util.Properties;
 /**
  * Sharding algorithm factory bean.
  */
-@Getter
 public final class ShardingAlgorithmFactoryBean implements FactoryBean<ShardingAlgorithm> {
 
     static {