Merge revision 9366 from trunk: Use LinkedHashSet in ResourceProperties

to preserve insertion order in properties updates.
This commit is contained in:
hns 2008-11-12 22:55:26 +00:00
parent 930c1cf6fc
commit fa3c971a6e

View file

@ -73,7 +73,7 @@ public class ResourceProperties extends Properties {
// TODO: we can't use TreeSet because we don't have the app's resource comparator // TODO: we can't use TreeSet because we don't have the app's resource comparator
// Since resources don't implement Comparable, we can't add them to a "naked" TreeSet // Since resources don't implement Comparable, we can't add them to a "naked" TreeSet
// As a result, resource ordering is random when updating. // As a result, resource ordering is random when updating.
resources = new HashSet(); resources = new LinkedHashSet();
} }
/** /**
@ -140,7 +140,7 @@ public class ResourceProperties extends Properties {
private ResourceProperties(ResourceProperties parentProperties, String prefix) { private ResourceProperties(ResourceProperties parentProperties, String prefix) {
this.parentProperties = parentProperties; this.parentProperties = parentProperties;
this.prefix = prefix; this.prefix = prefix;
resources = new HashSet(); resources = new LinkedHashSet();
setIgnoreCase(parentProperties.ignoreCase); setIgnoreCase(parentProperties.ignoreCase);
forceUpdate(); forceUpdate();
} }