JavaMoney / jsr354-api

JSR 354 - Money and Currency API
http://javamoney.org
Apache License 2.0
357 stars 79 forks source link

Fix concurrent initialization of MonetaryRoundings #32

Closed jhorstmann closed 10 years ago

jhorstmann commented 10 years ago

In a container or parallel test environment the initialization of MonetaryRoundings fails sporadically.

This fixes https://github.com/JavaMoney/jsr354-ri/issues/30, the issue was actually in the non-threadsafe usage of a ConcurrentMap inside DefaultServiceProvider in the api project and not the in the reference implementation.

This pull request is based on the 0.8 tag, since I'm currently still on java 7.

atsticks commented 10 years ago

Have included your changes (including some minor adaption to not expose unwanted deps to harmcrest). Cannot directly merge changes from non EG members into API (this is only possible for RI/TCK die to licencing constraints). But most of all: thank you very much for your contribution! See also https://github.com/JavaMoney/jsr354-api/commit/994ce62bcc4e9c5dff218bb8abf401e990eeba5f .