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
Control FX more effectively (FxRateLookup) #1666
Conversation
Move `FxRateLookup` to strata-calc and extend `CakculationParameter` Change `CalculationTask` to use parameter Extend `CalculationParameters` to search parent interfaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor things
CalculationParameter.class.isAssignableFrom(iface) && | ||
!parameters.containsKey(iface)) { | ||
|
||
aliases.put(iface.asSubclass(CalculationParameter.class), type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail if there are two values in parameters
of different classes that both implement the same interface that is a subtype of CalculationParameter
. It's ambiguous which one should be used so it should probably fail, but it might be nice to provide some explanation.
} | ||
|
||
private LookupScenarioFxRateProvider(ScenarioMarketData marketData, FxRateLookup lookup) { | ||
this.marketData = marketData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Null checks
* Control FX more effectively Move `FxRateLookup` to strata-calc and extend `CakculationParameter` Change `CalculationTask` to use parameter Extend `CalculationParameters` to search parent interfaces * Update from PR
Move
FxRateLookup
to strata-calc and extendCakculationParameter
Change
CalculationTask
to use parameterExtend
CalculationParameters
to search parent interfacesThis is a backwards incompatible change, however serialized instances of
RatesMarketDataLookup
will deserialize fine. Fixing the incompatibility simply requires an organize imports.