Return-Path: Delivered-To: apmail-velocity-commits-archive@locus.apache.org Received: (qmail 20856 invoked from network); 10 Oct 2008 22:12:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Oct 2008 22:12:52 -0000 Received: (qmail 79267 invoked by uid 500); 10 Oct 2008 22:12:46 -0000 Delivered-To: apmail-velocity-commits-archive@velocity.apache.org Received: (qmail 79234 invoked by uid 500); 10 Oct 2008 22:12:46 -0000 Mailing-List: contact commits-help@velocity.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@velocity.apache.org Delivered-To: mailing list commits@velocity.apache.org Received: (qmail 79009 invoked by uid 99); 10 Oct 2008 22:12:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 15:12:45 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 22:11:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A724A23888AF; Fri, 10 Oct 2008 15:11:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r703587 - in /velocity/engine/trunk/src: java/org/apache/velocity/runtime/directive/VelocimacroProxy.java test/org/apache/velocity/test/issues/Velocity625TestCase.java Date: Fri, 10 Oct 2008 22:11:53 -0000 To: commits@velocity.apache.org From: nbubna@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081010221153.A724A23888AF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: nbubna Date: Fri Oct 10 15:11:53 2008 New Revision: 703587 URL: http://svn.apache.org/viewvc?rev=703587&view=rev Log: VELOCITY-625 fix bug when calling macros w/too few arguments Added: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java (with props) 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=703587&r1=703586&r2=703587&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 Fri Oct 10 15:11:53 2008 @@ -151,7 +151,7 @@ if (callArguments > 0) { // the 0th element is the macro name - for (int i = 1; i < argArray.length; i++) + for (int i = 1; i < argArray.length && i <= callArguments; i++) { Node macroCallArgument = node.jjtGetChild(i - 1); Added: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java URL: http://svn.apache.org/viewvc/velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java?rev=703587&view=auto ============================================================================== --- velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java (added) +++ velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java Fri Oct 10 15:11:53 2008 @@ -0,0 +1,42 @@ +package org.apache.velocity.test.issues; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.velocity.test.BaseEvalTestCase; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.runtime.RuntimeConstants; + +/** + * This class tests VELOCITY-625. + */ +public class Velocity625TestCase extends BaseEvalTestCase +{ + public Velocity625TestCase(String name) + { + super(name); + } + + public void test1() + { + String template = "#macro(test $a $b)test#end#test('x')"; + assertEvalEquals("test", template); + } + +} Propchange: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java ------------------------------------------------------------------------------ svn:executable = * Propchange: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java ------------------------------------------------------------------------------ svn:keywords = Revision Propchange: velocity/engine/trunk/src/test/org/apache/velocity/test/issues/Velocity625TestCase.java ------------------------------------------------------------------------------ svn:mime-type = text/plain