Return-Path: Delivered-To: apmail-jakarta-velocity-dev-archive@www.apache.org Received: (qmail 30358 invoked from network); 4 Jan 2006 13:50:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jan 2006 13:50:26 -0000 Received: (qmail 4671 invoked by uid 500); 4 Jan 2006 13:50:24 -0000 Delivered-To: apmail-jakarta-velocity-dev-archive@jakarta.apache.org Received: (qmail 4454 invoked by uid 500); 4 Jan 2006 13:50:23 -0000 Mailing-List: contact velocity-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Velocity Developers List" Reply-To: "Velocity Developers List" Delivered-To: mailing list velocity-dev@jakarta.apache.org Received: (qmail 4443 invoked by uid 99); 4 Jan 2006 13:50:22 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Jan 2006 05:50:22 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id A9E38E1 for ; Wed, 4 Jan 2006 14:50:01 +0100 (CET) Message-ID: <2125144856.1136382601694.JavaMail.jira@ajax.apache.org> Date: Wed, 4 Jan 2006 14:50:01 +0100 (CET) From: "mike (JIRA)" To: velocity-dev@jakarta.apache.org Subject: [jira] Commented: (VELOCITY-132) IllegalArgumentException while calling an overloaded method Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/VELOCITY-132?page=comments#action_12361749 ] mike commented on VELOCITY-132: ------------------------------- I just downloaded the actual nightly src and tested the bug with the files which I included above. The fix dowsn't seem to solve the issue: In the old version (1.4) the output of the test is Integer $testobj.foo( $param ) in the patched new version it is $testobj.foo( $param ) String which isn't correct either. The correct output should be Integer String I don't think this is a minor bug so it should be fixed in 1.5 if in any case possible. If you need further information about the bug please contact me. > IllegalArgumentException while calling an overloaded method > ----------------------------------------------------------- > > Key: VELOCITY-132 > URL: http://issues.apache.org/jira/browse/VELOCITY-132 > Project: Velocity > Type: Bug > Components: Source > Versions: 1.3-rc1 > Environment: Operating System: All > Platform: All > Reporter: MySign > Fix For: 1.5 > Attachments: velocity_patch.patch > > If there are two methods with the same name and different parameters like: > public class myClass > { > public String foo ( Integer intObj ); > public String foo ( String str ); > } > and a velocity template like this > $myObj.foo( $someObj.getNull() ) > $myObj.foo( $str ) > while $someObj.getNull() returns null and $str is a java.lang.String object > with a String like 'test'. Because velocity caches the first method with the > Integer argument on calling with the parameter null (which isn't of course of > any type/class) the call fails with the String argument, because velocity tries > to call the foo( Integer intObj )! > In the velocity log appears a IllegalArgumentException which is right, but > velocity should call the right method! > mike -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: velocity-dev-help@jakarta.apache.org