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

Add smart stub conventions and switch to EOM #1829

Merged
merged 2 commits into from Oct 24, 2018
Merged

Conversation

@jodastephen
Copy link
Member

@jodastephen jodastephen commented Oct 18, 2018

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'
@@ -70,7 +70,7 @@ StubConvention toImplicit(PeriodicSchedule definition, boolean explicitInitialSt
/**
* 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
Contributor

@brianweller89 brianweller89 Oct 24, 2018

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?

Loading

Copy link
Member Author

@jodastephen jodastephen Oct 24, 2018

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.

Loading

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

@brianweller89 brianweller89 Oct 24, 2018

Choose a reason for hiding this comment

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

explicitEndDate not used

Loading

if (stubConv.isCalculateBackwards()) {
if (stubCnv.isCalculateBackwards()) {
ArgChecker.isFalse(explicitInitStub, "Value explicitInitStub must be false");
ArgChecker.isFalse(explicitFinalStub, "Value explicitFinalStub must be false");
Copy link
Contributor

@brianweller89 brianweller89 Oct 24, 2018

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?

Loading

Copy link
Member Author

@jodastephen jodastephen Oct 24, 2018

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.

Loading

*
* @return the roll convention, not null
*/
public RollConvention getRollConvention() {
return rollConvention != null ? rollConvention : RollConventions.NONE;
return rollConvention != null ? rollConvention : RollConventions.EOM;
Copy link
Contributor

@brianweller89 brianweller89 Oct 24, 2018

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?.

Loading

Copy link
Member Author

@jodastephen jodastephen Oct 24, 2018

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.

Loading

@jodastephen jodastephen merged commit 02ebd57 into master Oct 24, 2018
14 checks passed
Loading
@jodastephen jodastephen deleted the topic/schedule-enhance branch Oct 24, 2018
@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
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants