You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by by...@apache.org on 2009/01/11 10:47:49 UTC

svn commit: r733439 - /velocity/engine/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java

Author: byron
Date: Sun Jan 11 01:47:48 2009
New Revision: 733439

URL: http://svn.apache.org/viewvc?rev=733439&view=rev
Log:
VELOCITY-71 can't happen anymore with Velocity 1.6 since macro arg checking is done during render, so remove the check

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=733439&r1=733438&r2=733439&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 Sun Jan 11 01:47:48 2009
@@ -257,23 +257,6 @@
         // Throw exception for invalid number of arguments?
         if (getNumArgs() != i)
         {
-            // If we have a not-yet defined macro, we do get no arguments because
-            // the syntax tree looks different than with a already defined macro.
-            // But we do know that we must be in a macro definition context somewhere up the
-            // syntax tree.
-            // Check for that, if it is true, suppress the error message.
-            // Fixes VELOCITY-71.
-
-            for (Node parent = node.jjtGetParent(); parent != null;)
-            {
-                if ((parent instanceof ASTDirective)
-                        && StringUtils.equals(((ASTDirective) parent).getDirectiveName(), "macro"))
-                {
-                    return;
-                }
-                parent = parent.jjtGetParent();
-            }
-
             String msg = "VM #" + macroName + ": too "
                     + ((getNumArgs() > i) ? "few" : "many") + " arguments to macro. Wanted "
                     + getNumArgs() + " got " + i;