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

Dates must be in time-line order #2626

Open
glebvorobev1 opened this issue Jan 24, 2024 · 0 comments
Open

Dates must be in time-line order #2626

glebvorobev1 opened this issue Jan 24, 2024 · 0 comments

Comments

@glebvorobev1
Copy link

Hello! Probably have found some inconsistency.

  1. interface DayCount:
    public abstract int days(LocalDate firstDate, LocalDate secondDate):
    It says "Params:
    firstDate – the first date secondDate – the second date, which may be before the first date"

  2. but at DayCount implementation StandardDayCounts days method does not allow arbitrary args order so second date can not be before the first date anymore

@Override public int days(LocalDate firstDate, LocalDate secondDate) { if (secondDate.isBefore(firstDate)) { throw new IllegalArgumentException("Dates must be in time-line order"); } return calculateDays(firstDate, secondDate); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant