[ 
https://issues.jboss.org/browse/SEAMINTL-44?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12596500#comment-12596500
 ] 

Ken Finnigan commented on SEAMINTL-44:
--------------------------------------

So changing it to:

{quote}
text = bundles.get(clientLocale, 
textKey.getBundle()).getObject(textKey.getKey());
{quote}

Think that would work ok.  As you mention I think it would call toString() on 
the returned Object when assigning to text.

> BundleTemplateMessage breaks with non-String ResourceBundles
> ------------------------------------------------------------
>
>                 Key: SEAMINTL-44
>                 URL: https://issues.jboss.org/browse/SEAMINTL-44
>             Project: Seam International
>          Issue Type: Bug
>          Components: Messages
>    Affects Versions: 3.0.0.Final
>            Reporter: Nicklas Karlsson
>            Assignee: Ken Finnigan
>
> BundleTemplateMessages has in build()
> {code}
>         try {
>             text = bundles.get(clientLocale, 
> textKey.getBundle()).getString(textKey.getKey());
>         } catch (Exception e) {
>             log.warn("Could not load bundle: " + textKey);
>             text = textDefault;
>         }
> {code}
> which will result in a ClassCastException if the resource is non-string 
> (because ResourceBundle.getString implementation casts getObject to String) 
> and is further translated to a "Could not load bundle" warning followed by 
> the BundleKey being outputted. 
> Since ResourceBundle.getString is final, there is no way of overloading this 
> behaviour. Using toString on a non-null resource would give some flexibility 
> to this, perhaps.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to