Skip to content

Commit f27265b

Browse files
committed
Merge pull request lightbend#138 from fnuecke/master
Added ConfigRenderOptions entry for value sorting in objects.
2 parents 9c39077 + b38e708 commit f27265b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

config/src/main/java/com/typesafe/config/impl/SimpleConfigObject.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.io.Serializable;
88
import java.util.AbstractMap;
99
import java.util.ArrayList;
10+
import java.util.Arrays;
1011
import java.util.Collection;
1112
import java.util.Collections;
1213
import java.util.HashMap;
@@ -382,7 +383,9 @@ protected void render(StringBuilder sb, int indent, boolean atRoot, ConfigRender
382383
}
383384

384385
int separatorCount = 0;
385-
for (String k : keySet()) {
386+
String[] keys = keySet().toArray(new String[size()]);
387+
Arrays.sort(keys);
388+
for (String k : keys) {
386389
AbstractConfigValue v;
387390
v = value.get(k);
388391

0 commit comments

Comments
 (0)