Skip to content

Document time parsing and warn if time in milliseconds is out of range#4292

Merged
sbesson merged 1 commit intoome:developfrom
melissalinkert:gh-4142
Apr 25, 2025
Merged

Document time parsing and warn if time in milliseconds is out of range#4292
sbesson merged 1 commit intoome:developfrom
melissalinkert:gh-4142

Conversation

@melissalinkert
Copy link
Copy Markdown
Member

Fixes #4142.

This is mainly meant to clarify the expectations of decodeTime(int), namely that it takes the 32-bit int stored in a Metamorph file for the time of day in milliseconds, and converts to a human-readable string timestamp. The actual date is stored separately, so the number of milliseconds should represent less than 24 hours.

The only change in behavior should be that there is a warning if the number of milliseconds is outside the bounds of the number of milliseconds in a day (which is much narrower than int32 range). That shouldn't happen in practice with Metamorph data, but is included because this is a public method. I could see a case here for throwing IllegalArgumentException instead.

@melissalinkert melissalinkert added this to the 8.2.0 milestone Mar 12, 2025
@sbesson sbesson merged commit 6ce37c7 into ome:develop Apr 25, 2025
22 checks passed
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.

Argument #1 to org.joda.time.DateTime is declared as a long but an int is being passed in MetamorphReader.decodeTime(int millis).

2 participants