MonetaryCurrenciesSingletonSpi#getCurrency(CurrencyQuery query) returns null if the currency query did not find any match. The javadoc for the retuned value, however, promises something different: the {@link javax.money.CurrencyUnit} found, never null.. The method should probably throw a UnknownCurrencyException instead as all other MonetaryCurrenciesSingletonSpi#getCurrency methods.
@keilw I'll fix it. But I think it should throw MonetaryException and report not found rather than UnknownCurrencyException. By the way , I've already a JCP member under your suggestion.
MonetaryCurrenciesSingletonSpi#getCurrency(CurrencyQuery query)
returnsnull
if the currency query did not find any match. The javadoc for the retuned value, however, promises something different:the {@link javax.money.CurrencyUnit} found, never null.
. The method should probably throw aUnknownCurrencyException
instead as all otherMonetaryCurrenciesSingletonSpi#getCurrency
methods.https://github.com/JavaMoney/jsr354-api/blob/8816b273928b9433880569fe0d67dd92cb1c76e0/src/main/java/javax/money/spi/MonetaryCurrenciesSingletonSpi.java#L171-L173