You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Jeromy Evans (JIRA)" <ji...@apache.org> on 2008/02/26 23:17:08 UTC

[jira] Created: (WW-2511) i18n tag never calls getTexts(bundleName) of TextProvider

i18n tag never calls getTexts(bundleName) of TextProvider
---------------------------------------------------------

                 Key: WW-2511
                 URL: https://issues.apache.org/struts/browse/WW-2511
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.0.11, 2.1.1
            Reporter: Jeromy Evans


The i18n tag uses the following code to inoket the getTexts(bundleName) method using a TextProvider in the ValueStack:


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WW-2511) i18n tag never calls getTexts(bundleName) of TextProvider

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeromy Evans updated WW-2511:
-----------------------------

    Component/s: Other
    Description: 
The i18n tag uses the following code to invoke the getTexts(bundleName) method using a TextProvider in the ValueStack:

            ResourceBundle bundle = (ResourceBundle) findValue("texts('" + name + "')");

This never works.  It should read:

            ResourceBundle bundle = (ResourceBundle) findValue("getTexts('" + name + "')");

The code would have only occasionally caused problems as the tag calls LocalizedTextUtil.findResourceBundle(name...) anyway when the line above failed.

For the record, I think calling methods by embedding non-typesafe expressions in code is a bad idea.

  was:
The i18n tag uses the following code to inoket the getTexts(bundleName) method using a TextProvider in the ValueStack:


       Priority: Minor  (was: Major)

Bumped a key while writing original description.  Description updated

> i18n tag never calls getTexts(bundleName) of TextProvider
> ---------------------------------------------------------
>
>                 Key: WW-2511
>                 URL: https://issues.apache.org/struts/browse/WW-2511
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11, 2.1.1
>            Reporter: Jeromy Evans
>            Priority: Minor
>
> The i18n tag uses the following code to invoke the getTexts(bundleName) method using a TextProvider in the ValueStack:
>             ResourceBundle bundle = (ResourceBundle) findValue("texts('" + name + "')");
> This never works.  It should read:
>             ResourceBundle bundle = (ResourceBundle) findValue("getTexts('" + name + "')");
> The code would have only occasionally caused problems as the tag calls LocalizedTextUtil.findResourceBundle(name...) anyway when the line above failed.
> For the record, I think calling methods by embedding non-typesafe expressions in code is a bad idea.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WW-2511) i18n tag never calls getTexts(bundleName) of TextProvider

Posted by "Jeromy Evans (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeromy Evans resolved WW-2511.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.1

Committed change and created basic unit test

> i18n tag never calls getTexts(bundleName) of TextProvider
> ---------------------------------------------------------
>
>                 Key: WW-2511
>                 URL: https://issues.apache.org/struts/browse/WW-2511
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Other
>    Affects Versions: 2.0.11, 2.1.1
>            Reporter: Jeromy Evans
>            Priority: Minor
>             Fix For: 2.1.1
>
>
> The i18n tag uses the following code to invoke the getTexts(bundleName) method using a TextProvider in the ValueStack:
>             ResourceBundle bundle = (ResourceBundle) findValue("texts('" + name + "')");
> This never works.  It should read:
>             ResourceBundle bundle = (ResourceBundle) findValue("getTexts('" + name + "')");
> The code would have only occasionally caused problems as the tag calls LocalizedTextUtil.findResourceBundle(name...) anyway when the line above failed.
> For the record, I think calling methods by embedding non-typesafe expressions in code is a bad idea.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.