summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorJesse Greenwald2011-03-09 12:48:52 (EST)
committer Jesse Greenwald2011-03-09 13:00:24 (EST)
commitc68aba2a4816295d6d4e91b3394d228374c2ecf8 (patch)
tree39cd1471fe75f37bd3a4fecafc233dd6bfb02cc5
parentc7e9f013b716b6c25bffd8f4f83b738c1a1f1cd8 (diff)
downloadjgit-c68aba2a4816295d6d4e91b3394d228374c2ecf8.zip
jgit-c68aba2a4816295d6d4e91b3394d228374c2ecf8.tar.gz
jgit-c68aba2a4816295d6d4e91b3394d228374c2ecf8.tar.bz2
Fixed ordering of Config.getSubsections(...)refs/changes/79/2679/1
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
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
index ce86dc2..77ab150 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
@@ -55,9 +55,9 @@ import java.text.MessageFormat;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -1277,7 +1277,7 @@ public class Config {
}
public Set<String> parse(Config cfg) {
- final Set<String> result = new HashSet<String>();
+ final Set<String> result = new LinkedHashSet<String>();
while (cfg != null) {
for (final Entry e : cfg.state.get().entryList) {
if (e.subsection != null && e.name == null