Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on getProviderName() when a valid provider exists #242

Closed
manmedia opened this issue Nov 7, 2018 · 2 comments
Closed

Comments

@manmedia
Copy link

manmedia commented Nov 7, 2018

The following code generates a query successfully

CurrencyQuery query = CurrencyQueryBuilder.of().setProviderName("ProviderClassName").setCurrencyCodes("CNH").build();

But when the appropriate CurrencyProvider imp is loaded and getCurrencies(CurrencyQuery) is invoked, the following code results into NPE.

if (!query.isEmpty() && query.getProviderName().equals("SomeName")) {

      for (CurrencyUnit c : currencySet) {

          if (c.getCurrencyCodes().equals(query.getCurrencyCodes()) {

             return Collections.singleton(c);

          }

     }

}

We are always building the currency query such that it will have a provider name and currency unit. The above code results into an NPE for getProviderName() where a provider name actually exists.

@keilw
Copy link
Member

keilw commented Nov 7, 2018

This looks like a duplicate of JavaMoney/jsr354-api#100.

@keilw
Copy link
Member

keilw commented Dec 31, 2018

Closing here because it was already raised in the API

@keilw keilw closed this as completed Dec 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants