Author: byron
Date: Wed Feb 4 03:43:09 2009
New Revision: 740594
URL: http://svn.apache.org/viewvc?rev=740594&view=rev
Log:
Fixed number of arguments reported in macro mis-match argument exception
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
Modified:
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
URL:
http://svn.apache.org/viewvc/velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java?rev=740594&r1=740593&r2=740594&view=diff
==============================================================================
---
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
(original)
+++
velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
Wed Feb 4 03:43:09 2009
@@ -261,7 +261,7 @@
*/
private String buildErrorMsg(Node node)
{
- int i = node.jjtGetNumChildren(); // the number of arguments this call
provided
+ int i = node.jjtGetNumChildren() - 1; // the number of arguments this
call provided
String msg = "VM #" + macroName + ": too "
+ ((getNumArgs() > i) ? "few" : "many") + " arguments to macro. Wanted
"
+ getNumArgs() + " got " + i;