Skip to content

Commit 92d1c8e

Browse files
committed
Merge pull request arduino#100 from sgk/sortPrefs
Sort keys in the preferences.txt.
2 parents ce1ccb4 + 1750ff0 commit 92d1c8e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/src/processing/app/Preferences.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,11 +734,10 @@ static protected void save() {
734734
// Fix for 0163 to properly use Unicode when writing preferences.txt
735735
PrintWriter writer = PApplet.createWriter(preferencesFile);
736736

737-
Enumeration e = table.keys(); //properties.propertyNames();
738-
while (e.hasMoreElements()) {
739-
String key = (String) e.nextElement();
737+
String[] keys = (String[])table.keySet().toArray(new String[0]);
738+
Arrays.sort(keys);
739+
for (String key: keys)
740740
writer.println(key + "=" + ((String) table.get(key)));
741-
}
742741

743742
writer.flush();
744743
writer.close();

0 commit comments

Comments
 (0)