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

zhangliang 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 4c0b292ae8a Refactor constructor chaining for ShardingSphereConstraint 
and ShardingSphereIndex (#37004)
4c0b292ae8a is described below

commit 4c0b292ae8a8509691b972959fd5c48ebd338b78
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Nov 4 13:38:39 2025 +0800

    Refactor constructor chaining for ShardingSphereConstraint and 
ShardingSphereIndex (#37004)
    
    Replace manual field assignments with constructor chaining in 
ShardingSphereConstraint and ShardingSphereIndex to improve code 
maintainability and follow DRY principles.
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-authored-by: Claude <[email protected]>
---
 .../metadata/database/schema/model/ShardingSphereConstraint.java      | 3 +--
 .../infra/metadata/database/schema/model/ShardingSphereIndex.java     | 4 +---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereConstraint.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereConstraint.java
index fe6270b505e..151251436ad 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereConstraint.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereConstraint.java
@@ -35,7 +35,6 @@ public final class ShardingSphereConstraint {
     private final String referencedTableName;
     
     public ShardingSphereConstraint(final ConstraintMetaData 
constraintMetaData) {
-        name = constraintMetaData.getName();
-        referencedTableName = constraintMetaData.getReferencedTableName();
+        this(constraintMetaData.getName(), 
constraintMetaData.getReferencedTableName());
     }
 }
diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereIndex.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereIndex.java
index d3d5dca46db..9d305dc8e18 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereIndex.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/model/ShardingSphereIndex.java
@@ -39,8 +39,6 @@ public final class ShardingSphereIndex {
     private final boolean unique;
     
     public ShardingSphereIndex(final IndexMetaData indexMetaData) {
-        name = indexMetaData.getName();
-        columns = indexMetaData.getColumns();
-        unique = indexMetaData.isUnique();
+        this(indexMetaData.getName(), indexMetaData.getColumns(), 
indexMetaData.isUnique());
     }
 }

Reply via email to