velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r651285 - /velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java
Date Thu, 24 Apr 2008 14:59:31 GMT
Author: nbubna
Date: Thu Apr 24 07:59:17 2008
New Revision: 651285

URL: http://svn.apache.org/viewvc?rev=651285&view=rev
Log:
VELTOOLS-104 process resources with MessageFormat even if no args were given

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

Modified: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java?rev=651285&r1=651284&r2=651285&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java
(original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ResourceTool.java
Thu Apr 24 07:59:17 2008
@@ -208,12 +208,7 @@
      */
     public String render(Object resource, Object[] args)
     {
-        String value = String.valueOf(resource);
-        if (args == null)
-        {
-            return value;
-        }
-        return MessageFormat.format(value, args);
+        return MessageFormat.format(String.valueOf(resource), args);
     }
 
 



Mime
View raw message