bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/22639] bug in java.text.MessageFormat.format(Object[], St


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22639] bug in java.text.MessageFormat.format(Object[], StringBuffer, FieldPosition)
Date: 16 Oct 2005 01:26:10 -0000

A spurious IllegalArgumentException is thrown if there are multiple
ChoiceFormats in the pattern.  I've attached a test program which reproduces
the bug.  Here is a patch to (hopefully) fix the problem:

diff -u -r1.1 MessageFormat.java
--- MessageFormat.java  2002/06/24 13:56:20     1.1
+++ MessageFormat.java  2002/06/28 20:34:52
@@ -381,9 +381,10 @@
                MessageFormat mf = new MessageFormat ();
                mf.setLocale(locale);
                mf.applyPattern(buf.toString());
-               formatter = mf;
+               mf.format(arguments, appendBuf, ignore);
              }
-           formatter.format(thisArg, appendBuf, ignore);
+           else
+             formatter.format(thisArg, appendBuf, ignore);
          }

        appendBuf.append(elements[i].trailer);


------- Comment #1 from from-classpath at savannah dot gnu dot org  2002-06-28 
21:01 -------
I don't see the test program.
Could you send it?


------- Comment #2 from from-classpath at savannah dot gnu dot org  2002-07-02 
19:38 -------
I've checked in the fix for this.
I also checked in a follow-on fix for another bug revealed
by the test.
Finally, I put the test itself into Mauve.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22639





reply via email to

[Prev in Thread] Current Thread [Next in Thread]