On Mon, 23 Mar 2026 13:56:48 GMT, Jaikiran Pai <[email protected]> wrote:

>> Thanks for the feedback. I'll remove the constant and return -1 directly.
>> 
>> One thing I wanted to confirm: if the parsed date happens to be exactly 1 
>> second before the creation time, the delta would also be -1. In that case, 
>> it would be treated as a parse failure instead of an expired cookie. Is that 
>> acceptable, or should I use a value that can't collide with a real delta?
>
> It might be easier to make `expiryDate2DeltaSeconds` a static method and then 
> have it return the `Calendar` instance if the parsing completes successfully. 
> The call site can then use that non-null `Calendar` instance to trivially 
> compute the remaining time since the cookie was created. A `null` return from 
> `expiryDate2DeltaSeconds` would then imply that the expiry date couldn't be 
> computed and is thus unusable.

Of course, that would also mean renaming the method to something like 
`parseExpires`.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/30341#discussion_r2975221499

Reply via email to