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 60ee706647b Refactor ComputeNodeInstance (#31918)
60ee706647b is described below
commit 60ee706647bc1dd53dae8763838c78156ea07866
Author: Liang Zhang <[email protected]>
AuthorDate: Sat Jun 29 00:50:13 2024 +0800
Refactor ComputeNodeInstance (#31918)
---
.../org/apache/shardingsphere/infra/instance/ComputeNodeInstance.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
a/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstance.java
b/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstance.java
index 3e45751644f..290f1de6c97 100644
---
a/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstance.java
+++
b/infra/common/src/main/java/org/apache/shardingsphere/infra/instance/ComputeNodeInstance.java
@@ -26,7 +26,6 @@ import
org.apache.shardingsphere.infra.state.instance.InstanceStateContext;
import javax.annotation.concurrent.ThreadSafe;
import java.util.Collection;
-import java.util.Optional;
import java.util.concurrent.CopyOnWriteArrayList;
/**
@@ -48,7 +47,7 @@ public final class ComputeNodeInstance {
public ComputeNodeInstance(final InstanceMetaData metaData, final
Collection<String> labels) {
this.metaData = metaData;
- Optional.ofNullable(labels).ifPresent(this.labels::addAll);
+ this.labels.addAll(labels);
}
/**