Giter Site home page Giter Site logo

jsr354-ri's Introduction

JSR 354: Money and Currency: Moneta Reference Implementation

Maven Central CircleCI Coverage Status Stability: Maintenance License Join the chat at https://gitter.im/JavaMoney/jsr354-ri

Moneta is the reference implementation (RI) of the JSR 354 Money & Currency API and provides:

  • Monetary amounts: fixed sized FastMoney and Money for big amounts.
  • Currency conversion and rate providers.
  • Custom currencies support like the Bitcoin.

See Moneta User Guide for an introduction.

Usage

You can access the RI by adding the following Maven dependencies:

<dependency>
  <groupId>org.javamoney</groupId>
  <artifactId>moneta</artifactId>
  <version>1.4.4</version>
  <type>pom</type>
</dependency>

The same for Gradle:

compile group: 'org.javamoney', name: 'moneta', version: '1.4.4', ext: 'pom'

SBT:

libraryDependencies += "org.javamoney" % "moneta" % "1.4.4" pomOnly()

The release artifacts are accessible from Maven Central.

Release notes

The implementation supports JDK8 and later.

Help and support

Ask your question at StackOverflow with tag java-money or join the Gitter chat.

jsr354-ri's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsr354-ri's Issues

What happens when ECB website is down?

Hello,
i'm visiting a client in Ukraine. Now I try to show them a demo of my shop running locally and amazingly the product-details page does not load. Firefox just loads the page forever. 30 minutes later I get this exception in the log:

2017-11-20 18:05:30,930 org.javamoney.moneta.internal.loader.LoadableResource [https-jsse-nio-127.0.0.1-8112-exec-4] INFO : Failed to load resource input for ECBHistoric90RateProvider from http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml
java.net.SocketException: Connection timed out (Read failed)
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:735)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:706)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at org.javamoney.moneta.internal.loader.LoadableResource.load(LoadableResource.java:319)
	at org.javamoney.moneta.internal.loader.LoadableResource.loadRemote(LoadableResource.java:230)
	at org.javamoney.moneta.internal.loader.LoadRemoteDataLoaderService.execute(LoadRemoteDataLoaderService.java:41)
	at org.javamoney.moneta.internal.loader.DefaultLoaderServiceFacade.loadDataRemote(DefaultLoaderServiceFacade.java:51)
	at org.javamoney.moneta.internal.loader.DefaultLoaderService.registerData(DefaultLoaderService.java:163)
	at org.javamoney.moneta.internal.loader.LoaderConfigurator.initResource(LoaderConfigurator.java:92)
	at org.javamoney.moneta.internal.loader.LoaderConfigurator.load(LoaderConfigurator.java:59)
	at org.javamoney.moneta.internal.loader.DefaultLoaderService.initialize(DefaultLoaderService.java:99)
	at org.javamoney.moneta.internal.loader.DefaultLoaderService.<init>(DefaultLoaderService.java:83)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	at org.javamoney.moneta.internal.PriorityAwareServiceProvider.loadServices(PriorityAwareServiceProvider.java:98)
	at org.javamoney.moneta.internal.PriorityAwareServiceProvider.getServices(PriorityAwareServiceProvider.java:65)

So it seems like it cannot load the xml file with the exchange rates. So I ask my colleagues in Bulgaria if they can open this URL http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml and they say: "Yes, it downloads an xml file". I try to open it from Kiev in my browser and, again, firefox keeps loading forever and after 30 minutes tells me it cannot load the page. Meanwhile the ECB website http://www.ecb.europa.eu/home/html/index.en.html loads perfectly fine. So it's only the XML resource that cannot be downloaded for some reason!
My questions here:

  • is there anywhere where I can configure a timeout?
  • what would happen if one exchange rate provider does not fail, but instead takes forever to answer your call (like in my case).
  • is it possible the ECB or IMF blacklist me or my machines because I've been downloading too many times the XML echange rate file?

Rounding for SEK

Hi,

according to wikipedia[1], swedish krona should be rounded with 1.00 intervals.
How can this be achieved with moneta/jsr-354? I made a test with CHF, EUR and SEK. CHF is rounded correctly, EUR is no rounding, but SEK also shows no rounding.

Am I missing something or is it not suported?

Thanks,
Hel

import org.javamoney.moneta.CurrencyUnitBuilder;
import org.javamoney.moneta.Money;

import javax.money.CurrencyUnit;
import javax.money.Monetary;
import javax.money.MonetaryRounding;
import javax.money.RoundingQueryBuilder;
import javax.money.format.MonetaryFormats;
import java.util.Locale;

public class MonetaTest {
    public static void main(String[] args) {
        CurrencyUnit chf = CurrencyUnitBuilder.of("CHF","").build();
        CurrencyUnit eur = CurrencyUnitBuilder.of("EUR","").build();
        CurrencyUnit sek = CurrencyUnitBuilder.of("SEK","").build();

        MonetaryRounding rounding = Monetary.getRounding(
                RoundingQueryBuilder.of()
                        .setCurrency(chf)
                        .set("cashRounding", true).build());

        MonetaryRounding roundingEUR = Monetary.getRounding(
                RoundingQueryBuilder.of()
                        .setCurrency(eur)
                        .set("cashRounding", true).build());

        MonetaryRounding roundingSEK = Monetary.getRounding(
                RoundingQueryBuilder.of()
                        .setCurrency(sek)
                        .set("cashRounding", true).build());

        System.out.println(MonetaryFormats.getAmountFormat(new Locale("ch", "")).format(Money.of(3459.97,chf)));
        System.out.println(MonetaryFormats.getAmountFormat(new Locale("ch", "")).format(Money.of(3459.97,chf).with(rounding)));

        System.out.println(MonetaryFormats.getAmountFormat(new Locale("de", "")).format(Money.of(3459.97,eur)));
        System.out.println(MonetaryFormats.getAmountFormat(new Locale("de", "")).format(Money.of(3459.97,eur).with(roundingEUR)));

        System.out.println(MonetaryFormats.getAmountFormat(new Locale("sv", "")).format(Money.of(3459.97,sek)));
        System.out.println(MonetaryFormats.getAmountFormat(new Locale("sv", "")).format(Money.of(3459.97,sek).with(roundingSEK)));

    }
}
CHF 3,459.97
CHF 3,459.95
EUR 3.459,97
EUR 3.459,97
SEK 3 459,97
SEK 3 459,97

[1] https://en.wikipedia.org/wiki/Cash_rounding#Rounding_with_1.00_intervals

Separate Unit/Component Tests from Integration Tests

While a complete build could include all of them, it is a good practice to separate pure unit tests (which only test an actual class/component) from "integration tests" (taking external systems like IMF, etc. into consideration) Maven knows different cycles so we should separate all tests into the right ones.

scala 2.12.4 compatibility

When using moneta with scala 2.12.3 everything is fine. Attempt to upgrade to 2.12.4 causes:

javax.money.UnknownCurrencyException: Unknown currency code: USD (MonetaryCurrenciesSingletonSpi.java:74)

Adding non ISO 4217 currency

I am currently trying to create an instance of MonetaryAmount using:

    MonetaryAmount ma = Monetary.getDefaultAmountFactory()
        .setNumber(new BigDecimal(1))
        .setCurrency("CNH")
        .create();

this fails obviously, because CNH is no ISO 4217 code. Since I do not need converters or anything besides the pure MonetrayAmount object, is there a way to bypass this verification? If not, how could I add this as available currency for MonetaryAmount?

Right now this seems to work:

   MonetaryAmount cny = Monetary.getDefaultAmountFactory()
        .setNumber(new BigDecimal(1))
        .setCurrency("CNY")
        .create();
    CurrencyUnit cu = CurrencyUnitBuilder.of("CNH", cny.getCurrency().getContext()).build(true);

But it feels like I am not using the API correctly.

Question regarding creation of MonetaryAmount

Hello,

I am new to JSR354 and currently trying to integrate it in a project I am working on. For that I would like to have all newly created MonetaryAmount instances directly shortened to two decimal places.

I am creating a MonetaryContext as follows:

MonetaryContext mc = MonetaryContextBuilder.of().setMaxScale(2).setPrecision(64).set(RoundingMode.HALF_DOWN).build()

And afterwards my MonetaryAmount as follows:

Monetary.getDefaultAmountFactory().setContext(mc).setNumber(999.999).setCurrency("EUR").create()

What I expect is, that the created and assigned monetary context is used and the created Money object has a number value of "999.99" but instead it still has "999.999". I think it might be, because the piece of code bellow (AbstractAmountBuilder), does not realy do, what it should do and the JavaDoc says, namly taking the MonetaryContext into consideration while creating the BigDecimal. Am I correct or am I missing something?

    /**
     * Creates a new instance of {@link Monetary}, using the default {@link MonetaryContext}.
     *
     * @param number numeric value.
     * @return a {@code Money} combining the numeric value and currency unit.
     * @throws ArithmeticException      If the number exceeds the capabilities of the default {@link MonetaryContext}
     *                                  used.
     * @throws UnknownCurrencyException if the currency code can not be resolved to {@link CurrencyUnit}.
     */
    @Override
    public MonetaryAmountFactory<T> setNumber(double number) {
        this.number = new BigDecimal(String.valueOf(number));
        return this;
    }

Make Money::with less restritive to support interop with others implementations

I had a situation where I needed to implement my own MonetaryAmount (decorated Money) and now Im not able to integrate my code smooth with Money::with because theres a forced cast to Money. Is it possible to relax this and return a MonetaryAmount ?

    @Override
    public Money with(MonetaryOperator operator) { // <-- Can you return MonetaryAmount ?
        Objects.requireNonNull(operator);
        try {
            return Money.class.cast(operator.apply(this)); // <-- Can you relax this code ?
        } catch (MonetaryException e) {
            throw e;
        } catch (Exception e) {
            throw new MonetaryException("Operator failed: " + operator, e);
        }
    }

Exception in thread "main" java.lang.NoSuchMethodError: java.lang.Math.multiplyExact(JI)J

A Exception in thread "main" java.lang.NoSuchMethodError: java.lang.Math.multiplyExact(JI)J is thrown
using moneta-core-1.2.1 with jdk1.8.0_144

Full stack trace
Exception in thread "main" java.lang.NoSuchMethodError: java.lang.Math.multiplyExact(JI)J
at org.javamoney.moneta.FastMoney.negate(FastMoney.java:394)
at Main.main(Main.java:7)

Source file

import org.javamoney.moneta.FastMoney;


public class Main {

    public static void main(String[] args)    {
        FastMoney m = FastMoney.of(400, "CAD");
        m.negate();
    }
}

org.javamoney:moneta:1.2 requires Java 9+?

I checked the pom file of tag 1.2, both source and target compatibility are 1.8.

But I got below error when using 'org.javamoney:moneta:1.2' like below,

dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator',
	        'org.springframework.boot:spring-boot-starter-webflux',
            'org.springframework.cloud:spring-cloud-starter-config',
            'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client',
            'org.springframework.cloud:spring-cloud-starter-sleuth',
	        'org.springframework.cloud:spring-cloud-starter-openfeign',
            "org.springframework.boot:spring-boot-starter-data-mongodb",

            'org.javamoney:moneta:1.2',
            'org.apache.commons:commons-lang3:3.5'
    )

    runtime('org.springframework.boot:spring-boot-devtools')

    compileOnly('org.projectlombok:lombok')

    testCompile(
            'org.springframework.boot:spring-boot-starter-test',
            "de.flapdoodle.embed:de.flapdoodle.embed.mongo",
            'org.assertj:assertj-core:3.6.1',
            'io.projectreactor:reactor-test'
    )
}
/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=53474:/Applications/IntelliJ IDEA CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/junit/lib/junit-rt.jar:/Applications/IntelliJ IDEA CE.app/Contents/plugins/junit/lib/junit5-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib/tools.jar:/Users/kane/git/pilipa/accounting/pixel/out/integTest/classes:/Users/kane/git/pilipa/accounting/pixel/out/production/classes:/Users/kane/git/pilipa/accounting/pixel/out/production/resources:/Users/kane/git/pilipa/accounting/pixel/out/test/classes:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-actuator/2.0.1.RELEASE/1ae431903895eabeccbdd611580ce63b374ccd1b/spring-boot-starter-actuator-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-webflux/2.0.1.RELEASE/521e563e885bcbbe4a9ae87d2f28b96428948565/spring-boot-starter-webflux-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter-config/2.0.0.M9/7caeb506e73cac7a9a1dc0548037bceedf42eb0a/spring-cloud-starter-config-2.0.0.M9.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter-netflix-eureka-client/2.0.0.M8/47196f1a4959e4896393885a73da23c8c4b061c8/spring-cloud-starter-netflix-eureka-client-2.0.0.M8.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter-sleuth/2.0.0.M9/69d77962d7dbe8159a5ec2e4878816eea1fd2498/spring-cloud-starter-sleuth-2.0.0.M9.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter-openfeign/2.0.0.M2/ca84031e11913dac1cd40cdc87d472edf3046f00/spring-cloud-starter-openfeign-2.0.0.M2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-data-mongodb/2.0.1.RELEASE/6aa33e2e7f71ad8f2b599f730ed3636efd0f2460/spring-boot-starter-data-mongodb-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/de.flapdoodle.embed/de.flapdoodle.embed.mongo/2.0.3/ebd8f3f05a4095877b4ca73a1fbd5ac2e9efb853/de.flapdoodle.embed.mongo-2.0.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/de.flapdoodle.embed/de.flapdoodle.embed.process/2.0.2/7fe480f5a233ca5a485d8f5f48616f749adf1807/de.flapdoodle.embed.process-2.0.2.jar:/Users/kane/.m2/repository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/cn.pilipa/pilipa-spring-boot-starter-logging/2.0.10/c2096ab8f38c0619978ac2c1f661022ce7def386/pilipa-spring-boot-starter-logging-2.0.10.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-test/2.0.1.RELEASE/d6204ede44fa7e1df01d25509837bfa4b767fa28/spring-boot-starter-test-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.6.1/2536dd8bc957490ef33873398869ba261d8c6fc3/assertj-core-3.6.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.projectreactor/reactor-test/3.1.6.RELEASE/b10dfd54bf66627fa9ba36e85e9b49b1987e1f48/reactor-test-3.1.6.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-devtools/2.0.1.RELEASE/4286336d5897811de4f776e8491cfeddc42d2c13/spring-boot-devtools-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-json/2.0.1.RELEASE/f2e1aeeb1ac02bfa1b4f7254633484af1866fc65/spring-boot-starter-json-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter-netflix-ribbon/2.0.0.M8/700f3c418b5987c218c63e9012c5f9eaf24e66e8/spring-cloud-starter-netflix-ribbon-2.0.0.M8.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter-netflix-archaius/2.0.0.M8/7b10e6146b81ff0867513454c37764027cdf1716/spring-cloud-starter-netflix-archaius-2.0.0.M8.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-starter/2.0.0.M9/8203d83851337ff5e790597c03e678d29093566c/spring-cloud-starter-2.0.0.M9.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-netflix-eureka-client/2.0.0.M8/e8e38d7ee7b560cc77724d063a8cb9c2463a344d/spring-cloud-netflix-eureka-client-2.0.0.M8.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-netflix-core/2.0.0.M8/646685913a68ebeaffeecdf7afc5bc31c0c1263a/spring-cloud-netflix-core-2.0.0.M8.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-aop/2.0.1.RELEASE/c7f7b5b5e63edca2fb04899d13d8bad83377b4b3/spring-boot-starter-aop-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter/2.0.1.RELEASE/33abc1286b0aabea4f08ff4285d09e587835a716/spring-boot-starter-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-actuator-autoconfigure/2.0.1.RELEASE/794aa7d6b6e05563c69a4684d2f5b7c78e209b0a/spring-boot-actuator-autoconfigure-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.micrometer/micrometer-core/1.0.3/8234fa7ea2b2d6f7147209dcaaa7cd347951d5eb/micrometer-core-1.0.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-reactor-netty/2.0.1.RELEASE/36ad0a17391082ea9aab1d35c827af6f16379abd/spring-boot-starter-reactor-netty-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.hibernate.validator/hibernate-validator/6.0.9.Final/b149e4cce82379f11f6129eb3187ca8ae5404005/hibernate-validator-6.0.9.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-webflux/5.0.5.RELEASE/17cfbf7e5314bb2e8176f45443131ff565beb5e4/spring-webflux-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-config-client/2.0.0.M9/a48b22ccee477abd000e06491d042ccab1938ef6/spring-cloud-config-client-2.0.0.M9.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-web/5.0.5.RELEASE/d51dbb5cabe72ae02e400577bac48f7fc94088de/spring-web-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.synchronoss.cloud/nio-multipart-parser/1.1.0/c6c417fec6612584b1c34d4dd98c5a4e47e8c754/nio-multipart-parser-1.1.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.eureka/eureka-core/1.8.7/56d06d457d63681fe26f89a140262ac990f845c3/eureka-core-1.8.7.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.ribbon/ribbon-eureka/2.2.5/58016757f3ed6e98c0c1ca1f37d7855a2409551b/ribbon-eureka-2.2.5.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.eureka/eureka-client/1.8.7/3ef17c72bc70e7f1c61cad33bbfd68691d5331de/eureka-client-1.8.7.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/net.logstash.logback/logstash-logback-encoder/5.0/248cadfd7fd2833d941bc17d0055265e1989801/logstash-logback-encoder-5.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jsr310/2.9.3/7d739db3f7975d082acbbade17986d018dc473c2/jackson-datatype-jsr310-2.9.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.datatype/jackson-datatype-jdk8/2.9.3/75004a75b8a4d5927211141a679951d39999e6c4/jackson-datatype-jdk8-2.9.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-parameter-names/2.9.3/34c22452e76a4074ef47070c2f5e7a1f0ff95d7/jackson-module-parameter-names-2.9.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.github.openfeign/feign-hystrix/9.5.1/f9efeb59ff2380447dc75863eb7e4ecf054891c/feign-hystrix-9.5.1.jar:/Users/kane/.m2/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.ribbon/ribbon/2.2.5/3f97c8acfc68c35012f00d10b9ac63fc8f48d790/ribbon-2.2.5.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.ribbon/ribbon-httpclient/2.2.5/e2662937935d218f2c63105f6df39c3dfa0d06a1/ribbon-httpclient-2.2.5.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.ribbon/ribbon-transport/2.2.5/7c8e321322a98c72a36f4a81f84cafe21273c010/ribbon-transport-2.2.5.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.ribbon/ribbon-loadbalancer/2.2.5/5f713ef0b8d01580666face5e91d8c6af1daa468/ribbon-loadbalancer-2.2.5.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.ribbon/ribbon-core/2.2.5/80b6fe934799269073e69c5d7e67334459ef7e2e/ribbon-core-2.2.5.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.hystrix/hystrix-core/1.5.12/75379b6671fcaa9cec33035df684a68ec7741ca6/hystrix-core-1.5.12.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.netflix.archaius/archaius-core/0.7.5/dca1d103bb45a12bd128906dd5372ee237a90de8/archaius-core-0.7.5.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.9.3/193b96ef555b2f2573b576887ba9a93e4bf48e8c/jackson-databind-2.9.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.thoughtworks.xstream/xstream/1.4.10/dfecae23647abc9d9fd0416629a4213a3882b101/xstream-1.4.10.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-sleuth-core/2.0.0.M9/20495a4bd8159a2186689a22b05e34163011a605/spring-cloud-sleuth-core-2.0.0.M9.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-commons/2.0.0.M9/32b7a826d9801a973778f8864214ca7454f003cc/spring-cloud-commons-2.0.0.M9.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.github.openfeign/feign-slf4j/9.5.1/4770c5f4ad5d9014c161a86ff67891f81af409f1/feign-slf4j-9.5.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.github.openfeign/feign-core/9.5.1/590613b1bd18ec0396391fb259e00b7d685ee3e6/feign-core-9.5.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.mongodb/mongodb-driver/3.6.3/d462fcc4640ac69b35e7cd2491e992c6bdf82862/mongodb-driver-3.6.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-mongodb/2.0.6.RELEASE/ee9fedc59c82ae75021ac1277f73ec87146670fd/spring-data-mongodb-2.0.6.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.javamoney.moneta/moneta-convert-imf/1.2/335f2d0561c8a30f316cfb9b08780b47b4fb0e84/moneta-convert-imf-1.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.javamoney.moneta/moneta-convert-ecb/1.2/88e676d8d1aedffcc2fff82b0af95f1d131383a2/moneta-convert-ecb-1.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.javamoney.moneta/moneta-convert/1.2/dd1250e9da71d7885f0b202eb58676ccfb97ef79/moneta-convert-1.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.javamoney.moneta/moneta-core/1.2/50188f792aa78744d8cddbce9db34e9feedf2d92/moneta-core-1.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/javax.money/money-api/1.0.1/586def91ede8ca783a9fb127e0ff9f2cb77920e9/money-api-1.0.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/javax.annotation/javax.annotation-api/1.3.2/934c04d3cfef185a8008e7bf34331b79730a9d43/javax.annotation-api-1.3.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-logging/2.0.1.RELEASE/10681a28c95e9f9c0159327a1ed0c860517c7ad7/spring-boot-starter-logging-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-test-autoconfigure/2.0.1.RELEASE/c7a68c07f2a04323a67740f91d20818ec2e783b3/spring-boot-test-autoconfigure-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-test/2.0.1.RELEASE/77cede07b0e9da6c87d0dabcfe3e53ac56747d73/spring-boot-test-2.0.1.RELEASE.jar:/Users/kane/.m2/repository/com/jayway/jsonpath/json-path/2.4.0/json-path-2.4.0.jar:/Users/kane/.m2/repository/junit/junit/4.12/junit-4.12.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/2.15.0/b84bfbbc29cd22c9529409627af6ea2897f4fa85/mockito-core-2.15.0.jar:/Users/kane/.m2/repository/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar:/Users/kane/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/kane/.m2/repository/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-test/5.0.5.RELEASE/f7e3b83447e54056a91de1294ae6888343648dff/spring-test-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-autoconfigure/2.0.1.RELEASE/b0bf9d34ed70c6987a86cd58a009065e5fa02545/spring-boot-autoconfigure-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-actuator/2.0.1.RELEASE/aab310ca611fbdb3fe0f74f3f8644ee012abac8d/spring-boot-actuator-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/2.0.1.RELEASE/b8c5b14cbb0e52fdded8f98a8c1493cc74c7cf59/spring-boot-2.0.1.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-context/5.0.5.RELEASE/9cca4bf5acb693249a01c218f471c677b951d6e2/spring-context-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-aop/5.0.5.RELEASE/b11b61b94d7fb752a1c9bf3461d655c3084fae47/spring-aop-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-tx/5.0.5.RELEASE/b772fbba533da282adc89f33e2619ee8a8bba601/spring-tx-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-commons/2.0.6.RELEASE/4d65fdcbe258961e866f4f85c87c13193bbfd18c/spring-data-commons-2.0.6.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-beans/5.0.5.RELEASE/984445863c0bbdaaf860615762d998b471a6bf92/spring-beans-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-expression/5.0.5.RELEASE/fc6c7a95aeb7d00f4c65c338b08d97767eb0dd99/spring-expression-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-core/5.0.5.RELEASE/1bd9feb1d9dac6accd27f5244b6c47cfcb55045c/spring-core-5.0.5.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.xmlunit/xmlunit-core/2.5.1/4ffdb346572a7356f7521cd3119ce5287d2e339d/xmlunit-core-2.5.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.projectreactor.ipc/reactor-netty/0.7.6.RELEASE/d425f9c97d7e73f163b5c0d4ae0f8ac9a38a0cb3/reactor-netty-0.7.6.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.projectreactor/reactor-core/3.1.6.RELEASE/64dfad0f0a0e9022c949d678106d53f083b66d05/reactor-core-3.1.6.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.yaml/snakeyaml/1.19/2d998d3d674b172a588e54ab619854d073f555b5/snakeyaml-1.19.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.hdrhistogram/HdrHistogram/2.1.10/9e1ac84eed220281841b75e72fb9de5a297fbf04/HdrHistogram-2.1.10.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.latencyutils/LatencyUtils/2.0.3/769c0b82cb2421c8256300e907298a9410a2a3d3/LatencyUtils-2.0.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/2.0.1.Final/cb855558e6271b1b32e716d24cb85c7f583ce09e/validation-api-2.0.1.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.jboss.logging/jboss-logging/3.3.2.Final/3789d00e859632e6c6206adc0c71625559e6e3b0/jboss-logging-3.3.2.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.fasterxml/classmate/1.3.4/3d5f48f10bbe4eb7bd862f10c0583be2e0053c6/classmate-1.3.4.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.synchronoss.cloud/nio-stream-storage/1.1.3/986dba5f6e5eed20f0dba6ddc8e8a64a9ebdc2f3/nio-stream-storage-1.1.3.jar:/Users/kane/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-to-slf4j/2.10.0/f7e631ccf49cfc0aefa4a2a728da7d374c05bd3c/log4j-to-slf4j-2.10.0.jar:/Users/kane/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:/Users/kane/.m2/repository/com/netflix/netflix-commons/netflix-infix/0.3.0/netflix-infix-0.3.0.jar:/Users/kane/.m2/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar:/Users/kane/.m2/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar:/Users/kane/.m2/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar:/Users/kane/.m2/repository/com/netflix/servo/servo-core/0.10.1/servo-core-0.10.1.jar:/Users/kane/.m2/repository/com/netflix/servo/servo-internal/0.10.1/servo-internal-0.10.1.jar:/Users/kane/.m2/repository/com/netflix/netflix-commons/netflix-commons-util/0.1.1/netflix-commons-util-0.1.1.jar:/Users/kane/.m2/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar:/Users/kane/.m2/repository/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-context/2.0.0.M9/eb45351fea7ff6960a0d5d47adafc20dd5bd253f/spring-cloud-context-2.0.0.M9.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.security/spring-security-rsa/1.0.5.RELEASE/31bd1111ada2f455eb0f492ed09e39deda18ca99/spring-security-rsa-1.0.5.RELEASE.jar:/Users/kane/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-core/2.9.3/ea9b6fc7bc3ccba9777b0827091f9aa1f8580371/jackson-core-2.9.3.jar:/Users/kane/.m2/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar:/Users/kane/.m2/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar:/Users/kane/.m2/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar:/Users/kane/.m2/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar:/Users/kane/.m2/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpclient/4.5.5/1603dfd56ebcd583ccdf337b6c3984ac55d89e58/httpclient-4.5.5.jar:/Users/kane/.m2/repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.github.vlsi.compactmap/compactmap/1.2.1/27aec1f3162c14b8a1178bb5c75ab43b618308ef/compactmap-1.2.1.jar:/Users/kane/.m2/repository/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-netflix-ribbon/2.0.0.M8/8d3c38ea609d54749dbf49d19044253f46f21e8d/spring-cloud-netflix-ribbon-2.0.0.M8.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-netflix-archaius/2.0.0.M8/773aeeda26d06ea0e2db997c15a38176d3a0c534/spring-cloud-netflix-archaius-2.0.0.M8.jar:/Users/kane/.m2/repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar:/Users/kane/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.reactivex/rxjava/1.2.0/42bfaf64c94f3848ebf5cf1c2ea4ec9d1b3ac6c8/rxjava-1.2.0.jar:/Users/kane/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar:/Users/kane/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjweaver/1.8.13/ad94df2a28d658a40dc27bbaff6a1ce5fbf04e9b/aspectjweaver-1.8.13.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.aspectj/aspectjrt/1.8.13/bfc5a877fd80648e5467239d370735654aaf7a92/aspectjrt-1.8.13.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-context-log4j2/4.18.2/dd43bf5e8790bbc9e741ffd5337d8b32c1861ba6/brave-context-log4j2-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-instrumentation-spring-web/4.18.2/b999d25652c3ad06e0fbe0fcb652e5c8a813b0fa/brave-instrumentation-spring-web-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-instrumentation-spring-rabbit/4.18.2/6726a0d756905df3d719fc877b07b63fed51b181/brave-instrumentation-spring-rabbit-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-instrumentation-kafka-clients/4.18.2/3129704e961a46efcc1c3b0638794e2016246b07/brave-instrumentation-kafka-clients-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-instrumentation-httpclient/4.18.2/e5161fb11161af121626ffda3ceace7f9e92058d/brave-instrumentation-httpclient-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-instrumentation-httpasyncclient/4.18.2/bb85cbb784a7c6839fb1e55f42c52ff8f5633cc0/brave-instrumentation-httpasyncclient-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-instrumentation-spring-webmvc/4.18.2/7297c3909730551314f330b73b5904b69174296f/brave-instrumentation-spring-webmvc-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-instrumentation-servlet/4.18.2/9d05f4d601a079fa94fde511bc3976c9971cdf1e/brave-instrumentation-servlet-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave-instrumentation-http/4.18.2/a8d1e50c79410fe70721273ae31b474eb02005fa/brave-instrumentation-http-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.brave/brave/4.18.2/fd25dc2d38e514a5e905ea17ba7cb7d26c7829b4/brave-4.18.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework.security/spring-security-crypto/5.0.4.RELEASE/6ad3fe82501c2d78b61ebc6f6c19ab8ab9092898/spring-security-crypto-5.0.4.RELEASE.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.mongodb/mongodb-driver-core/3.6.3/f2c41ad5349cdb65a6f7bde16f5ebae9a0dbe5f5/mongodb-driver-core-3.6.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.mongodb/bson/3.6.3/6c85ddf1fc96eb8776213bef6665d005a564ecd3/bson-3.6.3.jar:/Users/kane/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/Users/kane/.m2/repository/net/minidev/json-smart/2.3/json-smart-2.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.7.11/f02857a4e2c66ccbe7aaad6100a0a6c461bce9b3/byte-buddy-1.7.11.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.7.11/b425a8933ca07edd03c6dbc8bc3b595fba9780de/byte-buddy-agent-1.7.11.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/2.6/639033469776fd37c08358c6b92a4761feb2af4b/objenesis-2.6.jar:/Users/kane/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jcl/5.0.5.RELEASE/f4a2854b9d865e8b86717595aec16f877f8c6489/spring-jcl-5.0.5.RELEASE.jar:/Users/kane/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna-platform/4.5.1/117d52c9f672d8b7ea80a81464c33ef843de9254/jna-platform-4.5.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/net.java.dev.jna/jna/4.5.1/65bd0cacc9c79a21c6ed8e9f588577cd3c2f85b9/jna-4.5.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.apache.commons/commons-compress/1.10/5eeb27c57eece1faf2d837868aeccc94d84dcc9a/commons-compress-1.10.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.reactivestreams/reactive-streams/1.0.2/323964c36556eb0e6209f65c1cef72b53b461ab8/reactive-streams-1.0.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler-proxy/4.1.23.Final/9da61616993d003fbf684e06542b68aa8d93abee/netty-handler-proxy-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-http/4.1.23.Final/47cc15932619fd831aaa67fb0968532636ab435a/netty-codec-http-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-handler/4.1.23.Final/a6314d244dd11db14249dc2d492e8dd3eec4cdb1/netty-handler-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-epoll/4.1.23.Final/8a8ad56081c66bb74362d5cc0a3cd620874ef1da/netty-transport-native-epoll-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcpkix-jdk15on/1.56/4648af70268b6fdb24674fb1fd7c1fcc73db1231/bcpkix-jdk15on-1.56.jar:/Users/kane/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar:/Users/kane/.m2/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.4.9/a86ce739e5a7175b4b234c290a00a5fdb80957a0/httpcore-4.4.9.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/commons-codec/commons-codec/1.11/3acb4705652e16236558f0f4f2192cc33c3bd189/commons-codec-1.11.jar:/Users/kane/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar:/Users/kane/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.github.andrewoma.dexx/dexx-collections/0.2/a1cff10827ee471c215a99585b99f00d3a602194/dexx-collections-0.2.jar:/Users/kane/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar:/Users/kane/.m2/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar:/Users/kane/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar:/Users/kane/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.reporter2/zipkin-reporter/2.5.0/234f573c5f09c08906d5ef33e38bcc5fc4069b23/zipkin-reporter-2.5.0.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.zipkin.zipkin2/zipkin/2.6.1/aba91583e9b024bd86beea4e54fa6d4c9a1eab58/zipkin-2.6.1.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-api/2.10.0/fec5797a55b786184a537abd39c3fa1449d752d6/log4j-api-2.10.0.jar:/Users/kane/.m2/repository/net/minidev/accessors-smart/1.2/accessors-smart-1.2.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec-socks/4.1.23.Final/db99145403f5e375faa347f8bd150c2079833a55/netty-codec-socks-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-codec/4.1.23.Final/d6599803bfefbe9a3e226702faade5df0cb678d1/netty-codec-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport-native-unix-common/4.1.23.Final/acb1d48526d42a0376852d1c242d48112123e745/netty-transport-native-unix-common-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-transport/4.1.23.Final/80dfcc723083e23058878ddbc33f5fb0ce9ec9e9/netty-transport-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-buffer/4.1.23.Final/c6c0705bbd5d68aebc2d5fdd48e9dda8a8ad6d3/netty-buffer-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-resolver/4.1.23.Final/19adaf9ad6833da7506cdccc7c6d16952f366fa5/netty-resolver-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/io.netty/netty-common/4.1.23.Final/387b1b9d0441646a5cf84eace2b3e15dd07aca47/netty-common-4.1.23.Final.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/org.bouncycastle/bcprov-jdk15on/1.56/a153c6f9744a3e9dd6feab5e210e1c9861362ec7/bcprov-jdk15on-1.56.jar:/Users/kane/.m2/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/joda-time/joda-time/2.9.9/f7b520c458572890807d143670c9b24f4de90897/joda-time-2.9.9.jar:/Users/kane/.m2/repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar:/Users/kane/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.8.2/3edcfe49d2c6053a70a2a47e4e1c2f94998a49cf/gson-2.8.2.jar:/Users/kane/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar:/Users/kane/.m2/repository/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar:/Users/kane/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 cn.pilipa.pixel.config.MongoConfigurationTest
objc[33246]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java (0x1095884c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10adb04e0). One of the two will be used. Which one is undefined.

java.lang.UnsupportedClassVersionError: org/javamoney/moneta/Money has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Align package name of API and RI for Conversion

The Moneta package for Conversion Providers is called
org.javamoney.moneta.conversion.*
While it only contains an "internal" sub-package, there's a discrepancy between its name and javax.money.convert.

Ideally both should be called "convert".

Disabling standard rate providers failed

As mentioned at Stackoverflow an issues was filed as JAVAMONEY-131 regarding disabling of the standard rate provider like ECBCurrentRateProvider, ECBHistoric90RateProvider, IMFRateProvider etc. The JIRA page mentioned above isn't available any longer, at github I can't find any regarding issue and with version 1.1 this bug still exists. Here the content of my javamoney.properties

# Turn off loading of the default Moneta ExchangeRateProviders.
{1}load.ECBCurrentRateProvider.type=NEVER
{1}load.ECBHistoric90RateProvider.type=NEVER
{1}load.ECBHistoricRateProvider.type=NEVER
{1}load.IMFRateProvider.type=NEVER
{1}load.AbstractECBRateProvider=NEVER

But somehow the services are started

The exchange rate with resourceId ECBHistoric90RateProvider was started remotely
The exchange rate with resourceId IMFRateProvider was started remotely
The exchange rate with resourceId ECBCurrentRateProvider was started remotely
Loaded ECBCurrentRateProvider exchange rates for days:1
Loaded ECBHistoric90RateProvider exchange rates for days:63
Loaded ECBHistoricRateProvider exchange rates for days:4358

How can I disable all standard provider ?

MaxScale on division

Is the test below correct? I expect quotient should have scale 2 because MonetaryContext of the dividend limits it.

@Test
public void maxScaleOnDivide() {
    MonetaryContext mc = MonetaryContextBuilder.of().setMaxScale(2).setPrecision(64).set(RoundingMode.CEILING).build();
    MonetaryAmount dividend = Monetary.getDefaultAmountFactory().setContext(mc).setNumber(100).setCurrency("EUR").create();
    MonetaryAmount quotient = dividend.divide(3);
    assertEquals(quotient.getContext().getMaxScale(), 2);
    assertEquals(quotient.getNumber().numberValue(BigDecimal.class), BigDecimal.valueOf(33.33));
}

At the moment it fails with:

Expected :2
Actual :-1

on first assertion and

Expected :33.33
Actual :33.33333333333333333333333333333333333333333333333333333333333334

on second.

Build fails with wrong or missing module definition

The Moneta build https://travis-ci.org/JavaMoney/jsr354-ri fails with the following error

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/travis/build/JavaMoney/jsr354-ri/moneta-core/src/main/java/org.javamoney.moneta/module-info.java:[23,29] module not found: java.money
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------

It seems the API on MavenCentral does not properly expose a module "java.money" or there's a different problem with module resolution. Java 9 Jigsaw is said to be disabled by default, not sure, if that has something to do with it?

MoneyAmountBuilder.DEFAULT_CONTEXT does not set precision

Steps to reproduce:

MonetaryAmount a = Monetary.getDefaultAmountFactory().setNumber(100).setCurrency("DKK").create();
a.divide(BigDecimal.valueOf(3));

This throws ArithmeticExpression.

The error can be spotted in MoneyAmountBuilder:

    static final MonetaryContext DEFAULT_CONTEXT =
           MonetaryContextBuilder.of(Money.class).set(64).setMaxScale(63).set(RoundingMode.HALF_EVEN).build();

Note the use of .set(64). This should have been .setPrecision(64).

BTW: Why doesn't the MoneyAmountBuilder use the Money.DEFAULT_MONETARY_CONTEXT?

Additions with moneta

Hi? Anyone please explain why this test is failing :

@test
public void MoneyTest() throws Exception {

    MonetaryAmount amount =  Money.of(12.00,"USD");
    MonetaryAmount fiveDollars =  Money.of(5.00,"USD");

    amount.add(fiveDollars);

    System.out.println(String.format("Money after add: %s",amount));

    assertTrue(Money.of(17,"USD").equals(amount));
}

Not compatible with java 9

Please see https://github.com/davidkarlsen/monetabug - Moneta doesn't work well with java 9. javax.annotation is on the classpath (since it is added transitively) - so there should not be a need to add the java.se.ee module.

The strange thing is that is only triggered when running the tests through surefire, and not in the IDE like IntelliJ. Other libraries that depend on javax.annotations work well both in IDE and through surefire.

No possibility to configure proxy configuration

There is no possibility to set the Java Money proxy setup for remote resource access such as conversion and currency data. This should be enabled.

This AFAIK is the same also in the backport implementation.

Concurrent initialization of MonetaryRoundings fails

In a container or parallel test environment the initialization of MonetaryRoundings fails sporadically. Using the 0.8 release the problem can be reproduced using the following test case:

import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

import java.math.BigDecimal;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;

import javax.money.MonetaryAmount;
import javax.money.MonetaryRoundings;

import org.javamoney.moneta.Money;

import org.junit.Test;

public class ConcurrentInitializationTest {

    static class Round implements Runnable {
        private final MonetaryAmount amount;

        Round(final MonetaryAmount amount) {
            this.amount = amount;
        }

        @Override
        public void run() {
            final MonetaryAmount rounded = amount.with(MonetaryRoundings.getRounding());
            assertEquals(new BigDecimal("12.12"), rounded.getNumber().numberValue(BigDecimal.class));
        }
    }

    private static final int THREAD_COUNT = 100;

    @Test
    public void shouldSupportConcurrentInitialization() throws ExecutionException, InterruptedException {
        final Money amount = Money.of("EUR", new BigDecimal("12.123"));

        // new Round(amount).call();
        final List<Thread> threads = new ArrayList<>(THREAD_COUNT);
        final List<Throwable> throwables = Collections.synchronizedList(new ArrayList<Throwable>());
        final Thread.UncaughtExceptionHandler uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(final Thread t, final Throwable e) {
                throwables.add(e);
            }
        };

        for (int i = 0; i < THREAD_COUNT; i++) {
            final Thread thread = new Thread(new Round(amount));
            thread.setUncaughtExceptionHandler(uncaughtExceptionHandler);
            thread.start();
            threads.add(thread);
        }

        for (Thread thread : threads) {
            thread.join();
        }

        assertThat(throwables, is(empty()));

    }
}

The testcase fails with the folliwing stacktrace:

Caused by: javax.money.MonetaryException: No Rounding found for currency EUR
at javax.money.MonetaryRoundings.getRounding(MonetaryRoundings.java:116)
at javax.money.MonetaryRoundings$DefaultCurrencyRounding.apply(MonetaryRoundings.java:289)
at org.javamoney.moneta.Money.with(Money.java:428)
... 3 more

Clarify/Fix NumberValue calculation for conversions

IMO the current number value used as round factor does not honor any MathContext/capabilities of the target amount:

In spi.AbstractCurrencyConversion:

protected NumberValue roundFactor(MonetaryAmount amount, NumberValue factor) should optionally round the factor to be used. By default this method will only round

  • as much as it is needed, so the factor can be handled by the target amount instance based on its
  • numeric capabilities. Rounding is applied only if amount.getContext().getMaxScale() > 0 as follows:
    • If the amount provides a MathContext as context property this is used.
    • If the amount provides a RoundingMode, this is used (default is RoundingMode.HALF_EVEN).
    • By default the scale used is scale of the conversion factor. If the acmount allows a higher scale based on amount.getContext().getMaxScale(), this higher scale is used.

Please leave your comments, if this should create any problems. You may also test the changes done with the latest master version of the repo.

Rename EZB to ECB

As class names are primarily English, it seems advisable to rename EZB to ECB in types like EZBCurrentRateProvider, etc.
Equivalents for IMF are also called IMF_, not IWF_ ;-)

Possible problem in IMF Exchange

Doing a tutorial about money API, and I found a behavior strange. In Exchange rate using the ECB to convert real to dollar the value goes very well (USD 4.4209622560512496568), but using IMF the value goes, I believe, wrong (USD 22.779024906).

import java.util.Locale;

import javax.money.CurrencyUnit;
import javax.money.MonetaryAmount;
import javax.money.MonetaryCurrencies;
import javax.money.convert.CurrencyConversion;
import javax.money.convert.ExchangeRateProvider;
import javax.money.convert.MonetaryConversions;

import org.javamoney.moneta.Money;

public class ExchangeExample {

public static void main(String[] args) {
       CurrencyUnit real = MonetaryCurrencies.getCurrency("BRL");
        CurrencyUnit dollar = MonetaryCurrencies.getCurrency(Locale.US);

    ExchangeRateProvider ecbRateProvider = MonetaryConversions
            .getExchangeRateProvider("ECB");

    ExchangeRateProvider imfRateProvider = MonetaryConversions
            .getExchangeRateProvider("IMF");
    CurrencyConversion ecbDollarConvertion = ecbRateProvider
            .getCurrencyConversion(dollar);

    CurrencyConversion imfDollarConvertion = imfRateProvider
            .getCurrencyConversion(dollar);

    MonetaryAmount money = Money.of(10, real);
    System.out.println(money.with(ecbDollarConvertion));
    System.out.println(money.with(imfDollarConvertion));
}

}

UnknownCurrencyException(CurrencyCode=EUR)

How can I resolve this issue? This happens with versions 1.0 and 1,1 on Java 8u111 and higher.

When I use

CurrencyUnit currency = Monetary.getCurrency(valuta);

I get an

UnknownCurrencyException(CurrencyCode=EUR)

Can this be a timing issue? Is the JDKCurrencyProvider lazy loaded?

Loading of IMF remote conversion data fails.

Loading of IMF conversion data actually fails (class org.javamoney.moneta.internal.loader.LoadableResource): with a default html response of "Request rejected". Interestingly calling the same URL from a browser, e.g. chrome works:

http://www.imf.org/external/np/fin/data/rms_five.aspx?tsvflag=Y

As a result the IMF and IMF-HIST rate provider fails to load because the response is a valid input stream, which unfortunately is not parsable to any conversion rates.

I did not check, if the behaviour in the backport is similar.

FastMoney or Money CompositeUserType mapping for Hibernate - ideas?

OK, I went through the API as much as I could and as I do fully understand why it is created the way it is - it causes a problem for JPA/Hibernate mapping.

The easiest and, possibly, the safest way is to use toString/Parse to represent the amount and currency in the DB. But this is far from perfect if one would like, well I do not know... like operate with SQL on this representation? sum, min, max... none will work on VARCHAR the way I would like to. But I do not see alternatives as I do not have setters to operate by property index on the object. Meaning either I have all data or I won't create an object that I can pass on by reference... or maybe I am missing something.

Any bits of advice? Thoughts on this? I would love to store FastMoney as two separate columns, but I do not see a reasonable option for this...

Fallback file is ignored on exchange rate loading failure

Hi,

I use
groupId: org.javamoney
artifactId: moneta
version: 1.1

I have created new exchange rate provider (CNB = czech national bank). Its endpoint is pretty unstable so I have to take advantage of having the fallback file with the historic exchange rates. Here is my javamoney.properties file:

{1}load.CNBCurrentRateProvider.type=SCHEDULED
{1}load.CNBCurrentRateProvider.at=16:00
{1}load.CNBCurrentRateProvider.resource=/javamoney/CNBCurrentRateProviderFallback.dat
{1}load.CNBCurrentRateProvider.urls=https://www.cnb.cz/en/financial_markets/foreign_exchange_market/exchange_rate_fixing/daily.txt
{1}load.CNBCurrentRateProvider.startRemote=true

Problem is that when the loading from URL failed, the fallback CNBCurrentRateProviderFallback.dat file is not used at all. I found that in the LoadableResource.shouldReadDataFromCallBack() there is !loadRemote() which has the wrong implementation as it should return true, on success, but it returns false on success.

DefaultExchangeRate.equals() is sensitive to BigDecimal equality semantics

DefaultExchangeRate.equals() requires that the conversion factors of the two objects are not only numerically equal, but also, in the case of BigDecimal, that the underlying BigDecimal instances have identical scales and precisions.

This prints "Rate does not equal":

ExchangeRate rateFromString = new ExchangeRateBuilder(ConversionContext.HISTORIC_CONVERSION)
    .setBase(Monetary.getCurrency("USD"))
    .setTerm(Monetary.getCurrency("EUR"))
    .setFactor(DefaultNumberValue.of(new BigDecimal("1.1")))
    .build();

ExchangeRate rateFromDouble = new ExchangeRateBuilder(ConversionContext.HISTORIC_CONVERSION)
    .setBase(Monetary.getCurrency("USD"))
    .setTerm(Monetary.getCurrency("EUR"))
    .setFactor(DefaultNumberValue.of(new BigDecimal(1.1)))
    .build();

if (rateFromDouble.equals(rateFromString)) {
  System.out.println("Rate equals");
} else {
  System.out.println("Rate does not equal");
}

This obeys the letter of the spec, which says the implementation should consider the "conversion factor" but is silent on whether that means the factor's numeric value or its precise object representation. But it's inconsistent with Money which normalizes amounts before testing for equality, and since the spec doesn't say one way or the other, doing a numeric-value comparison would, I'd think, also be compliant.

I'm running into this in the context of writing unit tests for an ExchangeRateProvider implementation; it's kind of a drag to have to either have to do my own field-by-field comparison of the DefaultExchangeRate rather than calling assertEquals() against an expected value or to carefully construct the factor in my expected value to exactly match the BigDecimal my application code computes (which makes the test more brittle than I'd prefer).

Happy to submit a pull request if the behavior change would be accepted.

Infinite recursion in DefaultExchangeRate.hashCode()

DefaultExchangeRate.hashCode() includes the exchange rate chain in the list of objects whose hash codes are combined to form the rate's hash code. Unfortunately, when no chain is specified explicitly in the builder, the default chain includes a reference to this, so hashCode() ends up calling itself until the stack overflows.

Currency symbol assumption is wrong

As reported in http://stackoverflow.com/questions/40244526/jsr-354-monetaryamountformat-not-working-two-way-for-other-currency-symbols-than?rq=1
the assumption of "$" has to be "USD" in
https://github.com/JavaMoney/jsr354-ri/blob/master/moneta-core/src/main/java/org/javamoney/moneta/internal/format/CurrencyToken.java
is wrong and a bug.
There are at least 3 other countries (Australia, Canada, New Zealand) using the exact same "$" symbol for totally different currencies like "AUD", etc. Not to mention other cases like "HK$" which you may also find abbreviated. see https://coderanch.com/t/463940/java/show-countries-currency-symbols

CurrencyConversionException using exchange rate providers

I tried to convert a currency using the following piece of code:

final MonetaryAmount inEuro = Money.of(10, "EUR");
final ExchangeRateProvider rateProvider = MonetaryConversions.getExchangeRateProvider("ECB");
final CurrencyConversion dollarConversion = rateProvider.getCurrencyConversion("USD");
final MonetaryAmount inDollar = inEuro.with(dollarConversion);
System.out.println(String.format("%s: %s ≙ %s", rateProvider, inEuro, inDollar));

The result was the following exception:

Exception in thread "main" CurrencyConversionException [base=EUR, term=null, conversionContext=null]: Cannot convert EUR into null
	at org.javamoney.moneta.spi.AbstractCurrencyConversion.apply(AbstractCurrencyConversion.java:109)
	at org.javamoney.moneta.Money.with(Money.java:377)
	at org.javamoney.moneta.Money.with(Money.java:58)
	at CurrencyConversionDemo.main(CurrencyConversionDemo.java:34)

From my point of view this code should work.

Loading of fallback resources fail

Loading of fallback resources using the LoaderService fails, because registered listeners are not called after loading the fallback data. This prevents loading of fallback data.

Money.toString() can output amounts in exponent notation

Money.toString() calls BigDecimal.toString() to format the numeric value. Combined with the fact that it normalizes BigDecimal values during initialization, this can result in unintuitive string representations.

BigDecimal fifty = new BigDecimal(50);
BigDecimal otherFifty = new BigDecimal(500).multiply(new BigDecimal(".1"));

System.out.println(fifty);
System.out.println(otherFifty);

System.out.println(Money.of(fifty, "USD"));
System.out.println(Money.of(otherFifty, "USD"));

produces

50
50.0
USD 50
USD 5E+1

Money.toString() should instead call BigDecimal.toPlainString() which is guaranteed to format the number in non-exponent notation.

ri/ri-bp use different config entries for defaults

RI and RI Backport use different config entries e.g.

org.javamoney.moneta.Money.defaults.XXX
org.javamoney.moneta.bp.Money.defaults.XXX
Money.defaults.XXX

This should be unified to org.javamoney.moneta.Money.defaults.XXX only.

DefaultNumberValue getAmountFractionDenominator throws ArithmeticException

The following code throws an ArithmeticException
for values with negative scale.

the scale of the BigDecimal is -1 in this case making BigDecimal.pow throw an exception

Money.of(BigDecimal.valueOf(10.00), "EUR").getNumber().getAmountFractionDenominator();
java.lang.ArithmeticException: Invalid operation
	at java.math.BigDecimal.pow(BigDecimal.java:2010)
	at org.javamoney.moneta.spi.DefaultNumberValue.getAmountFractionDenominator(DefaultNumberValue.java:173)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.