Skip to content

Commit b321bf0

Browse files
committed
Make JacksonConfig use TreeMap for reliable key ordering.
1 parent e60fcc2 commit b321bf0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/src/main/java/com/diffplug/spotless/json/JacksonConfig.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023 DiffPlug
2+
* Copyright 2023-2024 DiffPlug
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.util.Collections;
2020
import java.util.LinkedHashMap;
2121
import java.util.Map;
22+
import java.util.TreeMap;
2223

2324
/**
2425
* A DTO holding the basic for Jackson-based formatters
@@ -36,7 +37,7 @@ public class JacksonConfig implements Serializable {
3637
DEFAULT_FEATURE_TOGGLES = defaultFeatureToggles;
3738
}
3839

39-
protected Map<String, Boolean> featureToToggle = new LinkedHashMap<>(DEFAULT_FEATURE_TOGGLES);
40+
protected Map<String, Boolean> featureToToggle = new TreeMap<>(DEFAULT_FEATURE_TOGGLES);
4041

4142
public Map<String, Boolean> getFeatureToToggle() {
4243
return Collections.unmodifiableMap(featureToToggle);

0 commit comments

Comments
 (0)