Add smart stub conventions and switch to EOM#1829
Conversation
Add `SmartInitial` and `SmartFinal` conventions Use `SmartInitial` instead of `ShortInitial` as the default Enhance schedule builder to reduce chance of duplicate date errors Change conventions to use `SmartInitial` and 'EOM'
| * A short initial stub. | ||
| * <p> | ||
| * The schedule periods will be determined backwards from the end date. | ||
| * The schedule periods will be determined backwards from the regular period end date. |
There was a problem hiding this comment.
End date and regular period end date would be the same for initial stub?
There was a problem hiding this comment.
Yes. The wording covers the case when there is a stub at both ends.
| boolean explicitInitialStub, | ||
| LocalDate explicitStartDate, | ||
| boolean explicitFinalStub, | ||
| LocalDate explicitEndDate) { |
There was a problem hiding this comment.
explicitEndDate not used
| if (stubConv.isCalculateBackwards()) { | ||
| if (stubCnv.isCalculateBackwards()) { | ||
| ArgChecker.isFalse(explicitInitStub, "Value explicitInitStub must be false"); | ||
| ArgChecker.isFalse(explicitFinalStub, "Value explicitFinalStub must be false"); |
There was a problem hiding this comment.
Why are we having this restriction for backwards calculation only?
There was a problem hiding this comment.
It drops out of logic elsewhere. When either of those flags are true we generate forwards.
| */ | ||
| public RollConvention getRollConvention() { | ||
| return rollConvention != null ? rollConvention : RollConventions.NONE; | ||
| return rollConvention != null ? rollConvention : RollConventions.EOM; |
There was a problem hiding this comment.
Why are we now defaulting to EOM? This is alot more restrictive in terms of which dates are acceptable?.
There was a problem hiding this comment.
EOM means "prefer EOM". So it can still roll on the 5th or the 20th, its just that if the roll starts on the 30th November it will be treated as EOM instead of 30th.
Add
SmartInitialandSmartFinalconventionsUse
SmartInitialinstead ofShortInitialas the defaultEnhance schedule builder to reduce chance of duplicate date errors
Change conventions to use
SmartInitialandEOM