You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "WarnerJan Veldhuis (JIRA)" <ji...@apache.org> on 2009/12/30 13:31:29 UTC

[jira] Created: (CLK-600) Page.getMessage( message, params) does not accept null for params

Page.getMessage( message, params) does not accept null for params 
------------------------------------------------------------------

                 Key: CLK-600
                 URL: https://issues.apache.org/jira/browse/CLK-600
             Project: Click
          Issue Type: Improvement
          Components: core
    Affects Versions: 2.1.0
            Reporter: WarnerJan Veldhuis
            Priority: Trivial


Page.getMessage() method does not accept null as parameter for Object[] args while it should.

Instead of this:
            content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());

I have to write code like this:
            if (ex.getParameters() != null) {
                content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
            }
            else { 
                content = getMessage("exception_" + ex.getErrorType() + "_message");
            }

The underlying mechanism, MessageFormat.format(String, Object[]) has no trouble handling null as args, so I don't see the reason to bomb out with an IllegalArgumentException("Null args parameter");


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


[jira] Reopened: (CLK-600) Page.getMessage( message, params) does not accept null for params

Posted by "Bob Schellink (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLK-600?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Schellink reopened CLK-600:
-------------------------------


MessageFormat#format takes a vararg as message arguments, so perhaps we could do the same with getMessage?

    public String getMessage(String name, Object... args) {
        String value = getMessage(name);

        return MessageFormat.format(value, args);
    }

This way we only need a single getMessage method and can remove the other two.

> Page.getMessage( message, params) does not accept null for params 
> ------------------------------------------------------------------
>
>                 Key: CLK-600
>                 URL: https://issues.apache.org/jira/browse/CLK-600
>             Project: Click
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.1.0
>            Reporter: WarnerJan Veldhuis
>            Assignee: Malcolm Edgar
>            Priority: Trivial
>             Fix For: 2.1.0
>
>
> Page.getMessage() method does not accept null as parameter for Object[] args while it should.
> Instead of this:
>             content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
> I have to write code like this:
>             if (ex.getParameters() != null) {
>                 content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
>             }
>             else { 
>                 content = getMessage("exception_" + ex.getErrorType() + "_message");
>             }
> The underlying mechanism, MessageFormat.format(String, Object[]) has no trouble handling null as args, so I don't see the reason to bomb out with an IllegalArgumentException("Null args parameter");

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


[jira] Resolved: (CLK-600) Page.getMessage( message, params) does not accept null for params

Posted by "Bob Schellink (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLK-600?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Schellink resolved CLK-600.
-------------------------------

    Resolution: Fixed

Will open a separate issue for introducing a varargs getMessages method.

> Page.getMessage( message, params) does not accept null for params 
> ------------------------------------------------------------------
>
>                 Key: CLK-600
>                 URL: https://issues.apache.org/jira/browse/CLK-600
>             Project: Click
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.1.0
>            Reporter: WarnerJan Veldhuis
>            Assignee: Malcolm Edgar
>            Priority: Trivial
>             Fix For: 2.1.0
>
>
> Page.getMessage() method does not accept null as parameter for Object[] args while it should.
> Instead of this:
>             content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
> I have to write code like this:
>             if (ex.getParameters() != null) {
>                 content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
>             }
>             else { 
>                 content = getMessage("exception_" + ex.getErrorType() + "_message");
>             }
> The underlying mechanism, MessageFormat.format(String, Object[]) has no trouble handling null as args, so I don't see the reason to bomb out with an IllegalArgumentException("Null args parameter");

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


[jira] Assigned: (CLK-600) Page.getMessage( message, params) does not accept null for params

Posted by "Malcolm Edgar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLK-600?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Malcolm Edgar reassigned CLK-600:
---------------------------------

    Assignee: Malcolm Edgar

> Page.getMessage( message, params) does not accept null for params 
> ------------------------------------------------------------------
>
>                 Key: CLK-600
>                 URL: https://issues.apache.org/jira/browse/CLK-600
>             Project: Click
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.1.0
>            Reporter: WarnerJan Veldhuis
>            Assignee: Malcolm Edgar
>            Priority: Trivial
>
> Page.getMessage() method does not accept null as parameter for Object[] args while it should.
> Instead of this:
>             content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
> I have to write code like this:
>             if (ex.getParameters() != null) {
>                 content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
>             }
>             else { 
>                 content = getMessage("exception_" + ex.getErrorType() + "_message");
>             }
> The underlying mechanism, MessageFormat.format(String, Object[]) has no trouble handling null as args, so I don't see the reason to bomb out with an IllegalArgumentException("Null args parameter");

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


[jira] Resolved: (CLK-600) Page.getMessage( message, params) does not accept null for params

Posted by "Malcolm Edgar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLK-600?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Malcolm Edgar resolved CLK-600.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.0

Fix checked in, thanks for the issue.

> Page.getMessage( message, params) does not accept null for params 
> ------------------------------------------------------------------
>
>                 Key: CLK-600
>                 URL: https://issues.apache.org/jira/browse/CLK-600
>             Project: Click
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.1.0
>            Reporter: WarnerJan Veldhuis
>            Assignee: Malcolm Edgar
>            Priority: Trivial
>             Fix For: 2.1.0
>
>
> Page.getMessage() method does not accept null as parameter for Object[] args while it should.
> Instead of this:
>             content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
> I have to write code like this:
>             if (ex.getParameters() != null) {
>                 content = getMessage("exception_" + ex.getErrorType() + "_message", ex.getParameters());
>             }
>             else { 
>                 content = getMessage("exception_" + ex.getErrorType() + "_message");
>             }
> The underlying mechanism, MessageFormat.format(String, Object[]) has no trouble handling null as args, so I don't see the reason to bomb out with an IllegalArgumentException("Null args parameter");

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