Il giorno ven, 19/01/2007 alle 11.06 +0900, Ito Kazumitsu ha scritto: > > With this "else", the parsing breaks at the character ',' which is > > used in the format such as "#,##0.00". > > > > But without this "else", the parsing goes on ignoring any invalid > > characters. > > So this is my revised patch. It passes the Mauve test > gnu.testlet.java.text.DecimalFormat.parse and > gnu.testlet.java.text.NumberFormat.position.
Great!
> Still remains a question: what if ',' appears after '.' or in the
exponential
> part?
The question is easy, this pattern is not valid. But we have still a
problem here:
// invalid pattern
harness.checkPoint("0.##, no one way!");
boolean ok = false;
try
{
df.applyPattern("0.##, no one way!");
}
catch (IllegalArgumentException x)
{
ok = true;
}
harness.check (ok); // works 'till here
num = parseIt (df, "3,110", pp);
harness.check (num == null); // <-------- fails!
I'll try to understand why tomorrow.
Good night :)
Mario
--
Lima Software, SO.PR.IND. s.r.l.
http://www.limasoftware.net/
pgp key: http://subkeys.pgp.net/
Please, support open standards:
http://opendocumentfellowship.org/petition/
http://www.nosoftwarepatents.com/
signature.asc
Description: Questa รจ una parte del messaggio firmata digitalmente
