-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
MonetaryConversions.getConversion loosing rate date for exchange rate providers #374
Comments
Does that example contain relevant parts of the custom provider? |
Thanks for the super fast response. The example basically holds the unit test from above as maven project and github actions - to easily see the failing test. This said, feel free .... whatever is the best location in your opinion. Again, thanks for the fast pick-up. |
Sorry it took a bit before we could look into this, but I analyze this problem as part of anticipating a 1.4.3 release in the near future. Since there are separate problems accessing the configuration in unit tests, I created an ECBExample for all 3 variants with "ECB" as the default. It works for "ECB" and "ECB-HIST90", but so far fails for "ECB-HIST", similar to the test case you mentioned above. There could be an issue with the XML file |
This seems like an encoding issue or problem with illegal characters at least in ECB-HIST: Have to check that further, also analyzing exchange which is a Spring Boot API backed by ECB rates. |
I created a fork of exchange here. And it works rather convincing althouth the original repo hasn't been touched in over 6 years. Although I haven't tried it for IMF and problems like #353, using a REST Client (in this case the Spring RestTemplate, something that should change into any of the client libraries mentioned in #353) instead of the old JDK 1.0 |
This is still a major blocker as the SAX Parser consistently fails for ECB-HIST with:
It has nothing to do with modules and only occurs for the historic rates, but in theory if ECB does something to those files, it could also happen elsewhere. |
There has been a major breakthrough. While the cache in moneta-core still uses the error-prone |
Following the example to retrieve conversion rates for a given historic point in time
the LocalDate information is lost within calling
MonetaryConversions.getConversion
(callingMonetaryConversions#getMonetaryConversionsSpi().getConversion(conversionQuery)
-> callingMonetaryConversionsSingletonSpi#getConversion(ConversionQuery conversionQuery)
)The code fragment in question is
With a custom exchange rate provider, the issue manifests in
With the OTB exchange rate providers, it seems to work as those use the current LocalDate as fallback. I wrote the following test, that fails accordingly (minimal reproduceable example at https://github.com/l-ray/javamoney-poc/)
Hope, this is helpful.
The text was updated successfully, but these errors were encountered: