velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nbu...@apache.org
Subject svn commit: r599984 - /velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ClassTool.java
Date Fri, 30 Nov 2007 22:18:07 GMT
Author: nbubna
Date: Fri Nov 30 14:18:06 2007
New Revision: 599984

URL: http://svn.apache.org/viewvc?rev=599984&view=rev
Log:
make signature and javadocRef also recognize when last param is varargs

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

Modified: velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ClassTool.java
URL: http://svn.apache.org/viewvc/velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ClassTool.java?rev=599984&r1=599983&r2=599984&view=diff
==============================================================================
--- velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ClassTool.java (original)
+++ velocity/tools/trunk/src/main/java/org/apache/velocity/tools/generic/ClassTool.java Fri
Nov 30 14:18:06 2007
@@ -857,8 +857,9 @@
                 out.append(getName());
                 out.append('(');
                 boolean first = true;
-                for (Class param : params)
+                for (int i=0; i < params.length; i++)
                 {
+                    Class param = params[i];
                     if (first)
                     {
                         first = false;
@@ -877,7 +878,14 @@
                         {
                             out.append(param.getComponentType().getSimpleName());
                         }
-                        out.append("[]");
+                        if (i == params.length - 1 && isVarArgs())
+                        {
+                            out.append("...");
+                        }
+                        else
+                        {
+                            out.append("[]");
+                        }
                     }
                     else
                     {



Mime
View raw message