[ http://issues.apache.org/jira/browse/VELOCITY-370?page=all ]
     
Will Glass-Husain resolved VELOCITY-370:
----------------------------------------

    Resolution: Fixed

Thanks for the fix!  Applied to head.

> NullPointerException in Introspector.java
> -----------------------------------------
>
>          Key: VELOCITY-370
>          URL: http://issues.apache.org/jira/browse/VELOCITY-370
>      Project: Velocity
>         Type: Bug
>   Components: Source
>     Versions: 1.5
>  Environment: Operating System: Windows 2000
> Platform: PC
>     Reporter: Reggie Riser
>      Fix For: 1.5

>
> In line 116 of the getMethod method of Introspector.java, a 
> NullPointerException
> can be thrown at this line:
> msg = msg + params[i].getClass().getName();
> The scenario was that an overloaded method in a tool class in my context was
> being called with a null parameter (i.e., params[i] was null).  That resulted 
> in
> an AmbiguousException correctly being thrown, but the error message being 
> built
> in this method was never being shown because a NullPointerException occurred
> first.  Looking at the code, you would expect to see something like this:
> Introspection Error : Ambiguous method invocation someOverloadedMethod( null)
> for class class com.blah.blah.MyTool
> Instead I was seeing this:
> ASTMethod.execute() : exception from introspection : 
> java.lang.NullPointerException
> Easy fix should be:
> if (params[i] == null)
>     msg = msg + "null";
> else
>     msg = msg + params[i].getClass().getName();

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

Reply via email to