[jboss-jira] [JBoss JIRA] (LOGTOOL-93) Message bundles always use String.format() even if no format is used

James Perkins (JIRA) issues at jboss.org
Fri Jul 10 11:22:02 EDT 2015


     [ https://issues.jboss.org/browse/LOGTOOL-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Perkins closed LOGTOOL-93.
--------------------------------
    Resolution: Rejected


Yup, good point and that's probably why I did that. It could have a {{%n}} or similar format option.

> Message bundles always use String.format() even if no format is used
> --------------------------------------------------------------------
>
>                 Key: LOGTOOL-93
>                 URL: https://issues.jboss.org/browse/LOGTOOL-93
>             Project: Log Tool
>          Issue Type: Bug
>            Reporter: James Perkins
>            Assignee: James Perkins
>            Priority: Blocker
>             Fix For: 2.1.0.Alpha1
>
>
> The {{String.format()}} should only be used if formatting is needed. 
> {code:java|title=Interface.java}
> @Message("Test message")
> RuntimeException testMessage();
> {code}
> {code:java|title=Interface_$bundle.java}
> @Override
> public final RuntimeException testMessage() {
>     final RuntimeException result = new RuntimeException(String.format(testMessage$str()));
>     final StackTraceElement[] st = result.getStackTrace();
>     result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
>     return result;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list