summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2007-05-17 10:40:25 (EDT)
committerpelder2007-05-17 10:40:25 (EDT)
commit02a00ad003b0b6e2c38a542de3e2f10e736d322e (patch)
treef4e4d15f86c4e6f2724e3898f6faeedc6d2c0e1b
parent3ebd4453cb08ff74dadb6d93084c228ac8f114c1 (diff)
downloadorg.eclipse.jet-02a00ad003b0b6e2c38a542de3e2f10e736d322e.zip
org.eclipse.jet-02a00ad003b0b6e2c38a542de3e2f10e736d322e.tar.gz
org.eclipse.jet-02a00ad003b0b6e2c38a542de3e2f10e736d322e.tar.bz2
[187552] Generated tag library prefix variables are in random order
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java7
-rw-r--r--plugins/org.eclipse.jet/templates/v2/jet2java.jet7
2 files changed, 14 insertions, 0 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
index deeeb02..0968a6e 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/compiler/templates/v2/JET2JavaGeneratorNew.java
@@ -7,6 +7,8 @@ import org.eclipse.jet.core.parser.ast.*;
import org.eclipse.jet.internal.compiler.V2CodeGenVisitor;
import org.eclipse.jet.internal.compiler.TagUsageVisitor;
import org.eclipse.jet.taglib.TagLibraryReference;
+import java.util.Arrays;
+import java.util.Comparator;
import java.util.Iterator;
import org.eclipse.jet.internal.JavaUtil;
@@ -25,6 +27,11 @@ public class JET2JavaGeneratorNew implements JET2Template {
TagUsageVisitor tuv = new TagUsageVisitor();
cu.accept(tuv);
TagLibraryReference[] tlrefs = tuv.getUsedTagLibraryReferences(cu);
+ Arrays.sort(tlrefs, new Comparator() {
+ public int compare(Object o1, Object o2) {
+ return ((TagLibraryReference)o1).getTagLibraryId().compareTo(((TagLibraryReference)o2).getTagLibraryId());
+ }
+ });
final String nlConstantName = "NL"; //$NON-NLS-1$
out.write("package "); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.jet/templates/v2/jet2java.jet b/plugins/org.eclipse.jet/templates/v2/jet2java.jet
index 1203b77..f271ce0 100644
--- a/plugins/org.eclipse.jet/templates/v2/jet2java.jet
+++ b/plugins/org.eclipse.jet/templates/v2/jet2java.jet
@@ -5,6 +5,8 @@
<%@jet imports="org.eclipse.jet.internal.compiler.V2CodeGenVisitor"%>
<%@jet imports="org.eclipse.jet.internal.compiler.TagUsageVisitor"%>
<%@jet imports="org.eclipse.jet.taglib.TagLibraryReference"%>
+<%@jet imports="java.util.Arrays"%>
+<%@jet imports="java.util.Comparator"%>
<%@jet imports="java.util.Iterator"%>
<%@jet imports="org.eclipse.jet.internal.JavaUtil"%>
<%
@@ -12,6 +14,11 @@
TagUsageVisitor tuv = new TagUsageVisitor();
cu.accept(tuv);
TagLibraryReference[] tlrefs = tuv.getUsedTagLibraryReferences(cu);
+ Arrays.sort(tlrefs, new Comparator() {
+ public int compare(Object o1, Object o2) {
+ return ((TagLibraryReference)o1).getTagLibraryId().compareTo(((TagLibraryReference)o2).getTagLibraryId());
+ }
+ });
final String nlConstantName = "NL"; //$NON-NLS-1$
%>
package <%= cu.getOutputJavaPackage() %>;