Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor CronTrigger.java for readability #318

Closed
mswatosh opened this issue Aug 10, 2023 · 0 comments · Fixed by #327
Closed

Refactor CronTrigger.java for readability #318

mswatosh opened this issue Aug 10, 2023 · 0 comments · Fixed by #327
Assignees

Comments

@mswatosh
Copy link
Member

CronTrigger.java has a number of simply named variables that have overlapping meaning. We should refactor this class for readability.

For example, l is never described, and we see both min and m in some functions (where m is the index of a month)

Comments from my code review:

int d = Arrays.binarySearch(daysOfMonth, dayOfMonth);
int l = Arrays.binarySearch(daysOfMonth, dayOfMonth - lastDayOfMonth - 1);

I did some digging, and from what I see, d isn't (exactly) the day, it's the index of the day in the daysOfMonth array. And l is the offset from the last day of the month in the daysOfMonth array.

int m = Arrays.binarySearch(months, time.getMonthValue());

like above, m is the index of the month in the months array. None of these need to be updated now, but we may want to open an issue to refactor some of this for maintainability

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

Successfully merging a pull request may close this issue.

1 participant