[ http://mc4j.org/jira/browse/STS-387?page=all ]

Ben Gunter closed STS-387.
--------------------------

    Fix Version/s: Release 1.5
       Resolution: Duplicate
         Assignee: Ben Gunter  (was: Tim Fennell)

This is a duplicate of STS-371 and is already fixed in both the trunk and the 
1.4.x branch. Between 1.4.2 and 1.4.3 this bug surfaced when we fixed another 
bug described in STS-369.

> RedirectResolution.addParameter results in NPE.
> -----------------------------------------------
>
>                 Key: STS-387
>                 URL: http://mc4j.org/jira/browse/STS-387
>             Project: Stripes
>          Issue Type: Bug
>          Components: ActionBean Dispatching
>    Affects Versions: Release 1.4.3
>         Environment: Tomcat 5.5.12, Java 5.0
>            Reporter: Brian Nichols
>         Assigned To: Ben Gunter
>             Fix For: Release 1.5
>
>
> If a null value is passed into RedirectResolution.addParameter, a null 
> pointer exception will occur when building the redirect URL.  Here is how it 
> happens:
>       String value = null;
>       RedirectResolution res = new RedirectResolution("/myaction.action");
>       res.addParameter("name", value);                
>       return res;
> The null pointer exception occurs in UrlBuilder:116
>                 else if (v.getClass().isArray()) {
> Here is why it happens:
>       1) OnwardResolution.addParameter(String name, Object... values) adds 
> the null value as an object array with 1 item that has a value of null.  I 
> believe the null value should simply be null and not an array. 
>       2) UrlBuilder.addParameters "valueOrValues" is the same object array 
> with 1 item that has a value of null.
>       3) UrlBuilder.addParameter is called with the array.
>       4) UrlBuilder.addParameter handles a null array, but is does NOT handle 
> array of null item(s).
>       5) NPE thrown at line 116.
> Null paramaters used to work fine in 1.4.2.  In the interest of backwards 
> compatibility, this should be fixed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mc4j.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to