JavaMoney/javamoney-examples

Formatting and parsing using the US format not symmetric

Closed this issue · 10 comments

A Money instance written in the US format cannot be parsed again using the very same format.

In this example add the following line to see it fail:

Money.parse(usFormat.format(monetaryAmount), usFormat);

Using the German format works fine though.

Any tests cases exists to catch this issue? If not, we should first create it and then fix

Using the UK locale is broken, too. The line in the original description basically is the test case.

OK, I can't check right now but assign a bug label

I'm not sure, if it's subject to examples, but ideally we should have a unit test iterating all available locales...

Agree that it probably has to be fixed in the reference implementation but I couldn't find the tracker for that quickly and didn't want to forget about the glitch :).

On the other hand: examples in test case format usually help spotting regressions quite neatly as well.

I have to look at it. If I remember correctly there should a similar test
in the Tck, which afaik currently is failing...

We will do a hackergarten next week. Hope we have time to fix it then...

Anatole

Oliver Gierke notifications@github.com schrieb am Mi., 14. Jan. 2015 um
21:53:

Agree that it probably has to be fixed in the reference implementation but
I couldn't find the tracker for that quickly and didn't want to forget
about the glitch :).


Reply to this email directly or view it on GitHub
#12 (comment)
.

keilw commented

Is this still open? @olivergierke If you still face the problem, please file a JIRA ticket here: https://java.net/jira/browse/javamoney/ (same place as most JSRs ;-) RI is just being broken into modules for 1.0.1, we'd love to fix issues with that release if they are filed soon enough.

I cannot reproduce the error with Moneta 1.0. Seems to be fixed, thanks!

keilw commented

Thanks, then we can close it here. Feel free to open something in JIRA if you spot something else.

Yep. Afaik I also added a corredponding test. Mabe even as part of the tck, but I dot yet remember it exactly...
CheersAnatole

Von meinem Samsung Galaxy Smartphone gesendet.-------- Ursprüngliche Nachricht --------Von: Oliver Gierke notifications@github.com Datum: 20.07.2015 08:21 (GMT+01:00) An: JavaMoney/javamoney-examples javamoney-examples@noreply.github.com Cc: Anatole Tresch atsticks@gmail.com Betreff: Re: [javamoney-examples] Formatting and parsing using the US format
not symmetric (#12)
I cannot reproduce the error with Moneta 1.0. Seems to be fixed, thanks!


Reply to this email directly or view it on GitHub.