Ticket #5903 (closed enhancement: fixed)

Bug contains 2 commit(s) | SVN Diffs for #5903

 

Opened 1 year ago

Last modified 2 months ago

Support PluralFormat in MessageFormat#toPattern.

Reported by: yoshito Assigned to: doug
Priority: major Milestone: 4.2
Component: formatting Version:
Keywords: Cc:
Load: Xref:
Java Version: Operating System:
Project (C/J): ICU4J Weeks: 0.5
Review: yoshito

Description

As source code comment addressed, MessageFormat.toPattern is not implemented for PluralFormat yet. Thus, if an instance of MessageFormat has a nested PluralFormat, toPatten() - applyPattern() round trip ends up IllegalArgumentException.

Attachments

Change History

08/31/07 12:50:34 changed by yoshito

  • owner changed from somebody to doug.

03/21/08 10:56:33 changed by andy

  • weeks set to 0.5.

06/17/08 16:45:03 changed by doug

  • status changed from new to assigned.
  • milestone changed from 4.0 to 4.2.

Making this work is not as simple as I'd hoped, so I'm pushing it off.

06/17/08 17:38:49 changed by doug

Basically, the problem is that the unquoting that MessageFormat does before calling plural format is not undoable ("foo" and "'foo" both map to "'foo") so PluralFormat needs to supports quotes so that MessageFormat doesn't have to unquote. But if PluralFormat supports quotes, then some existing patterns will be treated differently, so this is a spec change. Even if we didn't change existing apis, we'd need to overload 5 APIs (4 constructors plus applyPattern) to specify the new quoting behavior.

We don't have time to propose a spec addition, and although PluralFormat API is draft 3.8, a behavior change is also problematic. I recommend changing the behavior for 4.2, relying on the @draft status (in which case it should not change to @stable for 4.0).

06/17/08 17:40:29 changed by doug

arrrgh, wikiformatting is using paired single quotes to trigger italics. The first "foo" above, where the italics start, should have a pair of single quotes after the double quote.

07/10/08 11:48:21 changed by doug

  • revw set to yoshito.

09/11/08 09:06:49 changed by yoshito

  • status changed from assigned to closed.
  • resolution set to fixed.

Add/Change #5903 (Support PluralFormat in MessageFormat#toPattern.)




Anti spam check: