From f7ca3c15df0b4048643cbec97a2e232d57f397d2 Mon Sep 17 00:00:00 2001 From: shedfreewu <49236872+shedfreewu@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:20:22 +0800 Subject: [PATCH] =?UTF-8?q?instance=20=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E4=BB=8E=20serviceKey=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=EF=BC=8C=E5=8D=B3=E5=AE=9E=E4=BE=8B=E7=BA=A7=E7=86=94=E6=96=AD?= =?UTF-8?q?=E7=9A=84=E6=B2=BB=E7=90=86=E8=A7=84=E5=88=99=E9=80=82=E7=94=A8?= =?UTF-8?q?=20serviceKey=20=E5=AF=B9=E5=BA=94=20namespace=20=E7=9A=84=20(#?= =?UTF-8?q?580)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: shedfreewu --- .../com/tencent/polaris/client/pojo/InstanceByProto.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/polaris-common/polaris-model/src/main/java/com/tencent/polaris/client/pojo/InstanceByProto.java b/polaris-common/polaris-model/src/main/java/com/tencent/polaris/client/pojo/InstanceByProto.java index 1b6a6e545..24fbec117 100644 --- a/polaris-common/polaris-model/src/main/java/com/tencent/polaris/client/pojo/InstanceByProto.java +++ b/polaris-common/polaris-model/src/main/java/com/tencent/polaris/client/pojo/InstanceByProto.java @@ -17,7 +17,6 @@ package com.tencent.polaris.client.pojo; -import com.google.protobuf.StringValue; import com.google.protobuf.UInt32Value; import com.tencent.polaris.api.pojo.CircuitBreakerStatus; import com.tencent.polaris.api.pojo.DetectResult; @@ -31,7 +30,6 @@ import java.util.Collections; import java.util.Map; import java.util.Objects; -import java.util.Optional; /** * 通过PB对象封装的实例信息 @@ -80,8 +78,7 @@ public int hashCode() { @Override public String getNamespace() { - return Optional.of(instance).map(ServiceProto.Instance::getNamespace). - map(StringValue::getValue).orElse(serviceKey.getNamespace()); + return serviceKey.getNamespace(); } @Override