diff --git a/CHANGES.md b/CHANGES.md index 48d7b9967b0..f726c5815bd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -19,6 +19,7 @@ Apollo 2.4.0 * [Feature: openapi query namespace support not fill item](https://github.com/apolloconfig/apollo/pull/5249) * [Refactor: align database ClusterName and NamespaceName fields lengths](https://github.com/apolloconfig/apollo/pull/5263) * [Feature: Added the value length limit function for AppId-level configuration items](https://github.com/apolloconfig/apollo/pull/5264) +* [Fix: ensure clusters order in envClusters open api](https://github.com/apolloconfig/apollo/pull/5277) ------------------ All issues and pull requests are [here](https://github.com/apolloconfig/apollo/milestone/15?closed=1) diff --git a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java index ef636615b6b..160066b41aa 100644 --- a/apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java +++ b/apollo-common/src/main/java/com/ctrip/framework/apollo/common/utils/BeanUtils.java @@ -28,6 +28,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -164,7 +165,7 @@ public static Map> aggByKeyToList(String key, List list) { */ @SuppressWarnings("unchecked") public static Set toPropertySet(String key, List list) { - Set set = new HashSet<>(); + Set set = new LinkedHashSet<>(); if (CollectionUtils.isEmpty(list)) {// 防止外面传入空list return set; }