diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-25 15:25:38 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-25 15:25:38 +0000 |
commit | e7f0db54e6cd5f70135783ac6a8bbf5a39227f02 (patch) | |
tree | ff76bbfb820a2300dc36aa9e4ebcca8dbb77c147 /libjava | |
parent | c97bf3a9211885e6963ea845a25e89c54d306cc9 (diff) | |
download | gcc-e7f0db54e6cd5f70135783ac6a8bbf5a39227f02.tar.gz |
2005-05-24 Gary Benson <gbenson@redhat.com>
PR libgcj/21736:
* java/text/MessageFormat.java (MessageFormatElement.setLocale):
Handle DateFormat.DEFAULT case correctly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100154 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 6 | ||||
-rw-r--r-- | libjava/java/text/MessageFormat.java | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 4d1cfb95b9a..be3a5351fd5 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2005-05-24 Gary Benson <gbenson@redhat.com> + + PR libgcj/21736: + * java/text/MessageFormat.java (MessageFormatElement.setLocale): + Handle DateFormat.DEFAULT case correctly. + 2005-05-21 Tom Tromey <tromey@redhat.com> PR libgcj/21703: diff --git a/libjava/java/text/MessageFormat.java b/libjava/java/text/MessageFormat.java index 6c1b0508bda..4a24afd1f44 100644 --- a/libjava/java/text/MessageFormat.java +++ b/libjava/java/text/MessageFormat.java @@ -113,6 +113,7 @@ public class MessageFormat extends Format formatClass = java.util.Date.class; int val = DateFormat.DEFAULT; + boolean styleIsPattern = false; if (style == null) ; else if (style.equals("short")) @@ -123,13 +124,15 @@ public class MessageFormat extends Format val = DateFormat.LONG; else if (style.equals("full")) val = DateFormat.FULL; + else + styleIsPattern = true; if (type.equals("time")) format = DateFormat.getTimeInstance(val, loc); else format = DateFormat.getDateInstance(val, loc); - if (style != null && val == DateFormat.DEFAULT) + if (styleIsPattern) { SimpleDateFormat sdf = (SimpleDateFormat) format; sdf.applyPattern(style); |