[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-624) Interpolator class does not handle null argument arrays and arrays with only one argument

Gavin King (JIRA) jira-events at jboss.com
Wed Dec 20 12:03:39 EST 2006


     [ http://jira.jboss.com/jira/browse/JBSEAM-624?page=all ]

Gavin King closed JBSEAM-624.
-----------------------------

    Fix Version/s: 1.1.1.GA
       Resolution: Done
         Assignee: Gavin King

fixed

> Interpolator class does not handle null argument arrays and arrays with only one argument
> -----------------------------------------------------------------------------------------
>
>                 Key: JBSEAM-624
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-624
>             Project: JBoss Seam
>          Issue Type: Bug
>            Reporter: Frank Ulbricht
>         Assigned To: Gavin King
>             Fix For: 1.1.1.GA
>
>
> In method Interpolator.interpolate(String, Object...) are two possible bugs:
> 1. If the params arrays is null the method throws a NullPointerException. The array originally comes from the method FacesMessages.addFromResourceBundle(String, Object...). If the method is called without arguments, like addFromResourceBundle("some_key") then Java will automatically create an array with length zero and everything works fine. But if the application get this array from somewhere else, and it is null, the problem begins.
> 2. If there is only one element in the array the params will not be formatted to the message at all. This is because of the line: 
> if ( params.length>1 && string.indexOf('{')>=0 ) ...
> should be:
> if ( params.length>0 && string.indexOf('{')>=0 ) ...

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

        



More information about the seam-issues mailing list