Fixed ordering of Config.getSubsections(...)
A standard HashSet was being used to store the list of subsections as they were being parsed. This was changed to use a LinkedHashSet so that iterating over the set would return values in the same order as they are listed in the config file. Change-Id: I4251f95b8fe0ad59b07ff563c9ebb468f996c37d
This commit is contained in:
parent
c7e9f013b7
commit
c68aba2a48
|
@ -55,9 +55,9 @@
|
||||||
import java.util.AbstractSet;
|
import java.util.AbstractSet;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -1277,7 +1277,7 @@ public boolean equals(Object other) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> parse(Config cfg) {
|
public Set<String> parse(Config cfg) {
|
||||||
final Set<String> result = new HashSet<String>();
|
final Set<String> result = new LinkedHashSet<String>();
|
||||||
while (cfg != null) {
|
while (cfg != null) {
|
||||||
for (final Entry e : cfg.state.get().entryList) {
|
for (final Entry e : cfg.state.get().entryList) {
|
||||||
if (e.subsection != null && e.name == null
|
if (e.subsection != null && e.name == null
|
||||||
|
|
Loading…
Reference in New Issue