On Mon, 23 Mar 2026 11:35:54 GMT, Volkan Yazici <[email protected]> wrote:

>> EunHyunsu has refreshed the contents of this pull request, and previous 
>> commits have been removed. The incremental views will show differences 
>> compared to the previous content of the PR. The pull request contains one 
>> new commit since the last revision:
>> 
>>   8380549: HttpCookie.expiryDate2DeltaSeconds returns 0 on parse failure, 
>> causing immediate cookie expiration
>
> src/java.base/share/classes/java/net/HttpCookie.java line 96:
> 
>> 94:     // Returned by expiryDate2DeltaSeconds when none of the date formats
>> 95:     // could parse the given expires value
>> 96:     private static final long EXPIRY_DATE_PARSE_FAILURE = Long.MIN_VALUE;
> 
> I'd have just hardcoded `-1`, documented in `expiryDate2DeltaSeconds`, and be 
> done with it. I'm not really sure if a constant sentinel is necessary. I will 
> leave that decision to @dfuch, who first [triaged] this issue.
> 
> [triaged]: https://mail.openjdk.org/pipermail/net-dev/2026-March/030263.html

I agree with Volkan, I think a class level constant like this isn't needed in 
this case. Returning `-1` should be fine to indicate that the value couldn't be 
parsed.

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

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

Reply via email to