Commit efd07556 authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1311: Lists should retain their order.

parent ed65536b
......@@ -724,7 +724,9 @@ public class JiveGlobals {
// Check for a legacy, comma separated value.
final String legacyValue = JiveGlobals.getProperty( parent );
final Collection<String> propertyNames = properties.getChildrenNames( parent );
// Ensure that properties are ordered.
final SortedSet<String> propertyNames = new TreeSet<>( properties.getChildrenNames( parent ) );
if ( propertyNames.isEmpty() )
{
if ( legacyValue != null )
......@@ -834,7 +836,7 @@ public class JiveGlobals {
{
if ( value != null && !value.isEmpty() )
{
final String childName = name + "." + i++;
final String childName = name + "." + String.format("%05d", i++ );
properties.put( childName, value );
}
}
......@@ -842,7 +844,7 @@ public class JiveGlobals {
// When no non-null, non-empty values are stored, store one to denote an empty collection.
if ( i == 1 )
{
properties.put( name + ".1", "" );
properties.put( name + ".00001", "" );
}
// The put's above will have generated events for each child property. Now, generate an event for the parent.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment