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 1b99387  call init method (#11931)
1b99387 is described below

commit 1b99387d8eb4a1d47ee9e691393c298978e7d584
Author: Superainbower <[email protected]>
AuthorDate: Mon Aug 23 16:39:10 2021 +0800

    call init method (#11931)
---
 .../sharding/classbased/ClassBasedShardingAlgorithmFactory.java       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/classbased/ClassBasedShardingAlgorithmFactory.java
 
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/classbased/ClassBasedShardingAlgorithmFactory.java
index d3a941c..f4dc403 100644
--- 
a/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/classbased/ClassBasedShardingAlgorithmFactory.java
+++ 
b/shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/classbased/ClassBasedShardingAlgorithmFactory.java
@@ -44,7 +44,9 @@ public final class ClassBasedShardingAlgorithmFactory {
         if (!superShardingAlgorithmClass.isAssignableFrom(result)) {
             throw new ShardingSphereException("Class %s should be implement 
%s", shardingAlgorithmClassName, superShardingAlgorithmClass.getName());
         }
-        return (T) result.newInstance();
+        T instance = (T) result.newInstance();
+        instance.init();
+        return instance;
     }
     
 }

Reply via email to