From 4d8a7626aa8740e764f6ea11ac3bf55f4185aaea Mon Sep 17 00:00:00 2001 From: "rui.zhang" Date: Thu, 12 May 2022 18:16:12 +0800 Subject: [PATCH] Hotfix issue 8350 (#8351) * optimization: in this case, renamed the variable definition * optimization: in this case, renamed the variable definition * optimization: revert the VipServer to Vipserver * optimization: reverse vipServer changes * optimization: recover renamed vipServer --- .../client/config/impl/ClientWorker.java | 2 +- .../alibaba/nacos/client/utils/EnvUtil.java | 22 +++++++++---------- .../nacos/client/utils/EnvUtilTest.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java b/client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java index 93e48522cf6..c5efb089563 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/impl/ClientWorker.java @@ -580,7 +580,7 @@ private Map getLabels() { labels.put(RemoteConstants.LABEL_MODULE, RemoteConstants.LABEL_MODULE_CONFIG); labels.put(Constants.APPNAME, AppNameUtils.getAppName()); labels.put(Constants.VIPSERVER_TAG, EnvUtil.getSelfVipserverTag()); - labels.put(Constants.AMORY_TAG, EnvUtil.getSelfAmorayTag()); + labels.put(Constants.AMORY_TAG, EnvUtil.getSelfAmoryTag()); labels.put(Constants.LOCATION_TAG, EnvUtil.getSelfLocationTag()); return labels; diff --git a/client/src/main/java/com/alibaba/nacos/client/utils/EnvUtil.java b/client/src/main/java/com/alibaba/nacos/client/utils/EnvUtil.java index 949cc2b005b..cb658b47fb4 100644 --- a/client/src/main/java/com/alibaba/nacos/client/utils/EnvUtil.java +++ b/client/src/main/java/com/alibaba/nacos/client/utils/EnvUtil.java @@ -31,7 +31,7 @@ public class EnvUtil { public static final Logger LOGGER = LogUtils.logger(EnvUtil.class); - private static String selfAmorayTag; + private static String selfAmoryTag; private static String selfVipserverTag; @@ -39,17 +39,17 @@ public class EnvUtil { public static void setSelfEnv(Map> headers) { if (headers != null) { - List amorayTagTmp = headers.get(Constants.AMORY_TAG); - if (amorayTagTmp == null) { - if (selfAmorayTag != null) { - selfAmorayTag = null; + List amoryTagTmp = headers.get(Constants.AMORY_TAG); + if (amoryTagTmp == null) { + if (selfAmoryTag != null) { + selfAmoryTag = null; LOGGER.warn("selfAmoryTag:null"); } } else { - String amorayTagTmpStr = listToString(amorayTagTmp); - if (!amorayTagTmpStr.equals(selfAmorayTag)) { - selfAmorayTag = amorayTagTmpStr; - LOGGER.warn("selfAmoryTag:{}", selfAmorayTag); + String amoryTagTmpStr = listToString(amoryTagTmp); + if (!amoryTagTmpStr.equals(selfAmoryTag)) { + selfAmoryTag = amoryTagTmpStr; + LOGGER.warn("selfAmoryTag:{}", selfAmoryTag); } } @@ -82,8 +82,8 @@ public static void setSelfEnv(Map> headers) { } } - public static String getSelfAmorayTag() { - return selfAmorayTag; + public static String getSelfAmoryTag() { + return selfAmoryTag; } public static String getSelfVipserverTag() { diff --git a/client/src/test/java/com/alibaba/nacos/client/utils/EnvUtilTest.java b/client/src/test/java/com/alibaba/nacos/client/utils/EnvUtilTest.java index 7ec496383ef..231321aafba 100644 --- a/client/src/test/java/com/alibaba/nacos/client/utils/EnvUtilTest.java +++ b/client/src/test/java/com/alibaba/nacos/client/utils/EnvUtilTest.java @@ -36,7 +36,7 @@ public void testSetSelfEnv() { headers.put(Constants.VIPSERVER_TAG, Arrays.asList("b", "2")); headers.put(Constants.LOCATION_TAG, Arrays.asList("c", "3")); EnvUtil.setSelfEnv(headers); - Assert.assertEquals("a,1", EnvUtil.getSelfAmorayTag()); + Assert.assertEquals("a,1", EnvUtil.getSelfAmoryTag()); Assert.assertEquals("b,2", EnvUtil.getSelfVipserverTag()); Assert.assertEquals("c,3", EnvUtil.getSelfLocationTag()); }