Author: mrdon
Date: Sun Jan  7 13:26:22 2007
New Revision: 493849

URL: http://svn.apache.org/viewvc?view=rev&rev=493849
Log:
Added lexical ordering for tags

Modified:
    
struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java

Modified: 
struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java
URL: 
http://svn.apache.org/viewvc/struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java?view=diff&rev=493849&r1=493848&r2=493849
==============================================================================
--- 
struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java
 (original)
+++ 
struts/maven/trunk/struts-annotations/src/main/java/org/apache/struts/annotations/taglib/apt/TagAnnotationProcessor.java
 Sun Jan  7 13:26:22 2007
@@ -28,6 +28,7 @@
 import java.io.PrintWriter;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.TreeMap;
 import java.util.Map;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -65,7 +66,7 @@
     private AnnotationProcessorEnvironment environment;
     private AnnotationTypeDeclaration tagDeclaration;
     private AnnotationTypeDeclaration tagAttributeDeclaration;
-    private Map<String, Tag> tags = new HashMap<String, Tag>();
+    private Map<String, Tag> tags = new TreeMap<String, Tag>();
 
     public TagAnnotationProcessor(AnnotationProcessorEnvironment env) {
         environment = env;
@@ -90,7 +91,7 @@
             // type
             TypeDeclaration typeDeclaration = (TypeDeclaration) declaration;
             String typeName = typeDeclaration.getQualifiedName();
-            HashMap<String, Object> values = getValues(typeDeclaration,
+            Map<String, Object> values = getValues(typeDeclaration,
                     tagDeclaration);
             // create Tag and apply values found
             Tag tag = new Tag();
@@ -109,7 +110,7 @@
             MethodDeclaration methodDeclaration = (MethodDeclaration) 
declaration;
             String typeName = methodDeclaration.getDeclaringType()
                     .getQualifiedName();
-            HashMap<String, Object> values = getValues(methodDeclaration,
+            Map<String, Object> values = getValues(methodDeclaration,
                     tagAttributeDeclaration);
             // create Attribute and apply values found
             TagAttribute attribute = new TagAttribute();
@@ -346,9 +347,9 @@
      *            The type of the annotation
      * @return name->value map of annotation values
      */
-    private HashMap<String, Object> getValues(Declaration declaration,
+    private Map<String, Object> getValues(Declaration declaration,
             AnnotationTypeDeclaration type) {
-        HashMap<String, Object> values = new HashMap<String, Object>();
+        Map<String, Object> values = new TreeMap<String, Object>();
         Collection<AnnotationMirror> annotations = declaration
                 .getAnnotationMirrors();
         // iterate over the mirrors.


Reply via email to