[jboss-jira] [JBoss JIRA] Commented: (LOGTOOL-10) MessageFormat.format is instance method
James Perkins (JIRA)
jira-events at lists.jboss.org
Wed Feb 16 17:17:13 EST 2011
[ https://issues.jboss.org/browse/LOGTOOL-10?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582787#comment-12582787 ]
James Perkins commented on LOGTOOL-10:
--------------------------------------
MessageFormat.format(String patter, Object... arguments) is a static method in the java.text.MessageFormat class. Not sure why it won't compile. This seems to compile okay:
@MessageLogger(projectCode = "TEST")
public interface TestLogger {
@Message(id = 1, value = "Value {0} is invalid." format = Format.MESSAGE_FORMAT)
String invalidValue(String value);
}
The above interface generates:
@Override
public final String invalidValue(final String value) {
String result = MessageFormat.format(((projectCode +"-00005:")+ invalidValue$str()), value);
return result;
}
> MessageFormat.format is instance method
> ---------------------------------------
>
> Key: LOGTOOL-10
> URL: https://issues.jboss.org/browse/LOGTOOL-10
> Project: Log Tool
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 1.0.0.Beta3
> Reporter: Jonathan Halliday
> Assignee: David Lloyd
>
> for methods of the form
> @Message(id = 1, value = "foo", format = MESSAGE_FORMAT)
> public String foobar();
> then generated code of the form
> String result = MessageFormat.format(((projectCode +"-1:")+ foo$str()));
> won't compile as format is an instance method.
> MessageLoggerImplementor.createBundleMethod needs patch to differentiate MESSAGE_FORMAT and PRINTF cases?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list