diff --git a/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java b/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java index 1462f741cf9..c72dfc1d127 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/json/JsonPrinter.java @@ -639,7 +639,7 @@ public static JsonObjectBuilder json(MetadataBlock metadataBlock, boolean printO jsonObjectBuilder.add("displayOnCreate", metadataBlock.isDisplayOnCreate()); JsonObjectBuilder fieldsBuilder = Json.createObjectBuilder(); - Set datasetFieldTypes = new HashSet<>(metadataBlock.getDatasetFieldTypes()); + Set datasetFieldTypes = new TreeSet<>(metadataBlock.getDatasetFieldTypes()); for (DatasetFieldType datasetFieldType : datasetFieldTypes) { Long datasetFieldTypeId = datasetFieldType.getId();