Skip to content

Commit

Permalink
Make properties ordering stable (#173)
Browse files Browse the repository at this point in the history
Fixes #171
cstamas authored Aug 25, 2024
1 parent dc0a1dc commit c70c9f6
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ public static void write(Properties properties, String comment, OutputStream out
properties.store(sw, comment);
List<String> lines = new ArrayList<>(Arrays.asList(sw.toString().split("\\R")));
lines.remove(comment != null ? 1 : 0);
lines.sort(String::compareTo); // make lines ordering stable
BufferedWriter w = new BufferedWriter(new OutputStreamWriter(out, ENCODING));
for (String line : lines) {
w.write(line);

0 comments on commit c70c9f6

Please sign in to comment.