Skip to content

Add smart stub conventions and switch to EOM#1829

Merged
jodastephen merged 2 commits intomasterfrom
topic/schedule-enhance
Oct 24, 2018
Merged

Add smart stub conventions and switch to EOM#1829
jodastephen merged 2 commits intomasterfrom
topic/schedule-enhance

Conversation

@jodastephen
Copy link
Copy Markdown
Contributor

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

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

End date and regular period end date would be the same for initial stub?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The wording covers the case when there is a stub at both ends.

boolean explicitInitialStub,
LocalDate explicitStartDate,
boolean explicitFinalStub,
LocalDate explicitEndDate) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we having this restriction for backwards calculation only?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we now defaulting to EOM? This is alot more restrictive in terms of which dates are acceptable?.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jodastephen jodastephen merged commit 02ebd57 into master Oct 24, 2018
@jodastephen jodastephen deleted the topic/schedule-enhance branch October 24, 2018 11:52
@jodastephen jodastephen added this to the v2.1 milestone Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants