Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.2
-
Fix Version/s: 1.3
-
Component/s: Converters
-
Labels:None
-
JDK version and platform:any
Description
The PropertiesConverter [1] currently serializes its map of key-value entries without ordering them first. Thus the resulting XML may change between runs, which is not very diff-friendly.
A possible solution could look like this (in PropertiesConverter.marshal(...)):
TreeSet s = new TreeSet(properties.keySet());
for (Iterator iterator = s.iterator(); iterator.hasNext() {
Object key = iterator.next();
Object value = properties.get(key);
Cheers,
Christopher
I've added this as optional functionality. Since the sorting will take time, is unnecessary regarding functionality and may be surprising for existing applications, you may now register a PropertyConverter instance on your own. The head revision supports a bool parameter to enable the sorting.