On Tue, 17 Nov 2026 16:00:53 GMT, Daniel Fuchs <[email protected]> wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Fix `long` overflow in `monotonicInstantMillis`
>
> src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java line 165:
>
>> 163: IDLE_TIMER_TASK_SCHEDULE, IDLE_TIMER_TASK_SCHEDULE,
>> TimeUnit.MILLISECONDS);
>> 164: if (reqRspTimeoutEnabled) {
>> 165: scheduler.scheduleAtFixedRate(
>
> Suggestion:
>
> scheduler.scheduleWithFixedDelay(
Applied in 2e23456.
> src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java line 1249:
>
>> 1247: * uses wall clock, and hence, is unsuitable for elapsed time
>> measurements.
>> 1248: */
>> 1249: private static long monotonicInstantMillis() {
>
> Could we rename this method to some name that does not contain Instant? Maybe
> something like `monotonicMilliTicks`?
Suggestion:
private static long monotonicMilliTicks() {
> src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java line 1250:
>
>> 1248: */
>> 1249: private static long monotonicInstantMillis() {
>> 1250: return TimeUnit.NANOSECONDS.toMillis(START_INSTANT_NANOS -
>> System.nanoTime());
>
> Suggestion:
>
> return TimeUnit.NANOSECONDS.toMillis(System.nanoTime() -
> START_INSTANT_NANOS);
Doh! :facepalm: Applied in ccef8165.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/33890#discussion_r4603346615
PR Review Comment: https://git.openjdk.org/jdk/pull/33890#discussion_r4603316356
PR Review Comment: https://git.openjdk.org/jdk/pull/33890#discussion_r4603331304