velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r672847 - /velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java
Date Mon, 30 Jun 2008 17:54:13 GMT
Author: nbubna
Date: Mon Jun 30 10:54:13 2008
New Revision: 672847

URL: http://svn.apache.org/viewvc?rev=672847&view=rev
Log:
go through toolboxes in reverse so tool class map matches lookup order

Modified:
    velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java

Modified: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java?rev=672847&r1=672846&r2=672847&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java (original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/ToolContext.java Mon Jun
30 10:54:13 2008
@@ -131,8 +131,12 @@
     public Map<String,Class> getToolClassMap()
     {
         Map<String,Class> toolClasses = new HashMap<String,Class>();
-        for (Toolbox toolbox : toolboxes)
+        // go thru toolboxes backwards so final map matches
+        // what would be found in lookups
+        int n = toolboxes.size();
+        for (int i = toolboxes.size() - 1; i >= 0; i--)
         {
+            Toolbox toolbox = toolboxes.get(i);
             toolClasses.putAll(toolbox.getToolClassMap());
         }
         return toolClasses;



Mime
View raw message