summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-08-16 11:53:03 (EDT)
committer pelder2006-08-16 11:53:03 (EDT)
commita9fe52b8b438c1d1db835b443192cbf11e114498 (patch)
treeb8510a9ca8ebbbbe7c4ac5a302bdddc4b7e6890d
parent17e102636f1441f70db9b654721ff8fad4aaf48a (diff)
downloadorg.eclipse.jet-a9fe52b8b438c1d1db835b443192cbf11e114498.zip
org.eclipse.jet-a9fe52b8b438c1d1db835b443192cbf11e114498.tar.gz
org.eclipse.jet-a9fe52b8b438c1d1db835b443192cbf11e114498.tar.bz2
[154070] Ensure attributes on directives are maintained in declaration order by using a LinkedHashMap. Update affected JUnits.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java4
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java3
-rw-r--r--tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected2
3 files changed, 5 insertions, 4 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java
index 4f55b6b..dc60ce8 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/compiler/JET2Directive.java
@@ -19,7 +19,7 @@ package org.eclipse.jet.compiler;
import java.util.Collections;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.Map;
@@ -48,7 +48,7 @@ public final class JET2Directive extends JET2ASTElement
{
super(ast, line, colOffset, start, end);
this.name = name;
- this.attributes = Collections.unmodifiableMap(new HashMap(attributes));
+ this.attributes = Collections.unmodifiableMap(new LinkedHashMap(attributes));
}
/**
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java
index 6742a44..a70cd95 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/parser/JETReader.java
@@ -24,6 +24,7 @@ import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.List;
import org.eclipse.emf.codegen.CodeGenPlugin;
@@ -560,7 +561,7 @@ public class JETReader
*/
public HashMap parseTagAttributes() throws JETException
{
- HashMap values = new HashMap(11);
+ HashMap values = new LinkedHashMap(11);
while (true)
{
skipSpaces();
diff --git a/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected b/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
index 0c61be6..b73ff74 100644
--- a/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
+++ b/tests/org.eclipse.jet.tests/data/taglibs.jet.astdump.expected
@@ -1,6 +1,6 @@
<directive name="taglib" line="1" col="1">
- <attribute name="prefix">test</attribute>
<attribute name="id">org.eclipse.jet.tests.TestLibrary</attribute>
+ <attribute name="prefix">test</attribute>
</directive>
<data>
"isAllUpper", "nl", "other", "tokenize", "upper"