velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r551642 - /velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolInfo.java
Date Thu, 28 Jun 2007 18:06:23 GMT
Author: nbubna
Date: Thu Jun 28 11:06:22 2007
New Revision: 551642

URL: http://svn.apache.org/viewvc?view=rev&rev=551642
Log:
the dynamicProperties will essentially never be null, so we will always be doing configuration
and can streamline that a bit

Modified:
    velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolInfo.java

Modified: velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolInfo.java
URL: http://svn.apache.org/viewvc/velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolInfo.java?view=diff&rev=551642&r1=551641&r2=551642
==============================================================================
--- velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolInfo.java (original)
+++ velocity/tools/branches/2.x/src/main/java/org/apache/velocity/tools/ToolInfo.java Thu
Jun 28 11:06:22 2007
@@ -220,19 +220,16 @@
         /* if the tool is configurable and we have properties... */
         Map<String,Object> combinedProps =
             combine(this.properties, dynamicProperties);
-        if (combinedProps != null)
+        //TODO: make this step optional?
+        // look for specific setters
+        for (String name : combinedProps.keySet())
         {
-            //TODO: make this step optional?
-            // look for specific setters
-            for (String name : combinedProps.keySet())
-            {
-                setProperty(tool, name, combinedProps.get(name));
-            }
+            setProperty(tool, name, combinedProps.get(name));
+        }
 
-            if (hasConfigure())
-            {
-                invoke(getConfigure(), tool, combinedProps);
-            }
+        if (hasConfigure())
+        {
+            invoke(getConfigure(), tool, combinedProps);
         }
         return tool;
     }
@@ -344,18 +341,12 @@
     protected Map<String,Object> combine(Map<String,Object>... maps)
     {
         Map<String,Object> combined = new HashMap<String,Object>();
-        boolean none = true;
         for (Map<String,Object> map : maps)
         {
             if (map != null)
             {
-                none = false;
                 combined.putAll(map);
             }
-        }
-        if (none)
-        {
-            return null;
         }
         return combined;
     }



Mime
View raw message