You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/20 08:27:13 UTC

[GitHub] [pulsar] HQebupt commented on a diff in pull request #16138: [improve][broker] Use LinkedHashSet for config items of type Set to preserve elements order

HQebupt commented on code in PR #16138:
URL: https://github.com/apache/pulsar/pull/16138#discussion_r901391420


##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/FieldParser.java:
##########
@@ -212,7 +212,7 @@ public static <T> void setEmptyValue(String strValue, Field field, T obj)
             if (field.getType().equals(List.class)) {
                 field.set(obj, new ArrayList<>());
             } else if (field.getType().equals(Set.class)) {
-                field.set(obj, new HashSet<>());
+                field.set(obj, new LinkedHashSet<>());

Review Comment:
   If order is required, it is recommended to use `List` instead of `Set`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org