You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bu...@apache.org on 2003/02/03 15:53:59 UTC

DO NOT REPLY [Bug 16707] New: - IllegalArgumentException while calling an overloaded method

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16707>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16707

IllegalArgumentException while calling an overloaded method

           Summary: IllegalArgumentException while calling an overloaded
                    method
           Product: Velocity
           Version: 1.3-rc1
          Platform: All
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Source
        AssignedTo: velocity-dev@jakarta.apache.org
        ReportedBy: posting02@mysign.ch


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

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org