Skip to content

Commit

Permalink
Make properties ordering stable
Browse files Browse the repository at this point in the history
Fixes #171
  • Loading branch information
cstamas committed Aug 24, 2024
1 parent ebf5079 commit 53ba6ec
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 53ba6ec

Please sign in to comment.