commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Benson (JIRA)" <>
Subject [jira] Commented: (LANG-362) Add ExtendedMessageFormat to org.apache.commons.lang.text
Date Wed, 27 Feb 2008 16:23:52 GMT


Matt Benson commented on LANG-362:

OK I have a couple of points
Custom sub-formats are not supported - so if I embed a "custom" format in a choice format
it throws an IllegalArgumentException. Do we want to support that scenario or document clearly
that it doesn't work?
(I did make this point in

I had missed your having made that point.  I will look into this and see how heinous it is.

Now the setFormats(), setFormat(), and setFormatByArgumentIndex() all throw UnsupportedOperationException
I don't see the need for the logic to re-create the pattern - much simpler to just cache the
pattern the EMF was created with and return that value in toPattern() - or am I missing something?

Yes--jt.MF strips unnecessary whitespace and further may mangle e.g. date patterns if it can't
differentiate between subformats (usu. because you've specified a pattern or style that collides
with the system default); recreating the pattern allows the subclass to have output as close
as possible to what would be created by the superclass (identical when no custom subformats
are used).

the test cases could (and IMO should) be simpler - currently there are four classes to test
EMF (AbstractMessageFormatTest, ExtendedMessageFormatBaselineTest, MessageFormatExtensionTest.
and MessageFormatTest) and I don't see why we don't just have one ExtendedMessageFormatTest).
Tests are often a good way to look at how something works - so the simpler the better both
for those maintaining it and users wanting to understand how to use it.

I will concede that now that we are not reinventing the proverbial wheel the existing test
cases are overkill.  :)

> Add ExtendedMessageFormat to org.apache.commons.lang.text
> ---------------------------------------------------------
>                 Key: LANG-362
>                 URL:
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Matt Benson
>            Assignee: Matt Benson
>            Priority: Minor
>             Fix For: 2.4
>         Attachments:, extendedMessageFormat.patch.txt, extendedMessageFormat.patch.txt,,,
> Discussed on dev@ (
); adding here for tracking purposes and in case anyone has any serious objections to my implementation.
 Patch forthcoming...

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

View raw message