Skip to content

Refactor SessionSchedule to use java.time classes#1225

Draft
Copilot wants to merge 8 commits into
masterfrom
copilot/rework-sessionschedule-util-time
Draft

Refactor SessionSchedule to use java.time classes#1225
Copilot wants to merge 8 commits into
masterfrom
copilot/rework-sessionschedule-util-time

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 16, 2026

  • Refactored quickfixj-core/src/main/java/quickfix/DefaultSessionSchedule.java from Calendar/SimpleDateFormat internals to java.time (Instant, ZonedDateTime, DateTimeFormatter) and epoch-millis TimeInterval boundaries.
  • Updated weekly/day-of-week session calculations in DefaultSessionSchedule to use WeekFields.SUNDAY_START, including previous-day/week rollover handling.
  • Updated SessionSchedule API in quickfixj-core/src/main/java/quickfix/SessionSchedule.java to use isSameSession(long, long) plus a ZonedDateTime default bridge method.
  • Updated quickfixj-core/src/main/java/quickfix/Session.java to call the long-based schedule API using session creation time millis.
  • Updated quickfixj-core/src/main/java/quickfix/NoopStore.java creation-time handling to use SystemTime.currentTimeMillis()/Instant, and to derive calendar values on demand.
  • Added/updated calendar/date-focused tests in quickfixj-core/src/test/java/quickfix/SessionScheduleTest.java, including testSessionStartInPreviousDayOfWeek() and ZonedDateTime-based isSameSession assertions.
  • Added quickfixj-core/src/test/java/quickfix/DefaultSessionScheduleTest.java coverage for stable UTC toString() formatting.
  • Included follow-up fix in quickfixj-core/src/test/java/quickfix/LogUtilTest.java so the store stub throws from getCreationTime() (matching the updated session path).
  • Re-ran targeted tests for SessionScheduleTest and LogUtilTest after the changes.

Copilot AI and others added 6 commits May 16, 2026 08:54
@chrjohn
Copy link
Copy Markdown
Member

chrjohn commented May 16, 2026

@copilot LogUtilTest.testLogThrowable:51 fails

Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/6e680b34-2576-43e6-8a75-bcadbffdd3df

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 16, 2026

@copilot LogUtilTest.testLogThrowable:51 fails

Fixed in 3ea3d92 by updating LogUtilTest to throw from getCreationTime(), which is the MessageStore method the current session path uses. I also re-ran LogUtilTest and SessionScheduleTest locally and both pass.

Copilot AI requested a review from chrjohn May 16, 2026 20:58
@chrjohn chrjohn changed the title Backport SessionScheduleTest coverage for previous-day start-of-week handling Refactor SessionSchedule to use java.time classes May 17, 2026
@chrjohn
Copy link
Copy Markdown
Member

chrjohn commented May 17, 2026

Hi @alexwibowo , any news regarding #1147 ? Could you take a look at this PR? I copied your failing test also to this branch and it seems to work... i need to do a final review though.

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

Successfully merging this pull request may close these issues.

2 participants