[EMAIL PROTECTED] writes:

>URL: http://svn.apache.org/viewcvs?rev=321226&view=rev
>Log:
>make sure a null parameter map is never passed to configurable tools

Ugh! This also changes the sematics of the method call! If there are
no parameters, then configure is not called at all. What about tools
that rely on the method being called no matter what parameters are
passed in?

I'd change that to

if (configurable)
{
    Map params = (parameters == null) ? Collections.EMPTY_MAP : parameters;
    ((Configurable)tool).configure(params);
}

        Best regards
                Henning



>Modified:
>    
> jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/ViewToolInfo.java

>Modified: 
>jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/ViewToolInfo.java
>URL: 
>http://svn.apache.org/viewcvs/jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/ViewToolInfo.java?rev=321226&r1=321225&r2=321226&view=diff
>==============================================================================
>--- 
>jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/ViewToolInfo.java
> (original)
>+++ 
>jakarta/velocity/tools/trunk/src/java/org/apache/velocity/tools/view/ViewToolInfo.java
> Fri Oct 14 14:54:13 2005
>@@ -183,7 +183,7 @@
>             LOG.error("Exception while instantiating instance of \"" +
>                     getClassname() + "\": " + e);
>         }
>-        if (configurable)
>+        if (configurable && parameters != null)
>         {
>             ((Configurable)tool).configure(parameters);
>         }



>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
[EMAIL PROTECTED]        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

                      4 - 8 - 15 - 16 - 23 - 42

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to