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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to