On Fri, 30 Sep 2022 10:40:28 GMT, Michael McMahon <[email protected]> wrote:

>> Daniel Jeliński has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Describe oldClient
>
> src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java line 330:
> 
>> 328:             long currentTime = System.currentTimeMillis();
>> 329:             KeepAliveEntry e = peekFirst();
>> 330:             if ((currentTime - e.idleStartTime) > nap) {
> 
> Since `peekFirst` can return null in theory, should we check for it? 
> Currently `pop` is used which throws an exception instead, and probably means 
> it doesn't happen in practice, but maybe it could be flagged in static source 
> code analysis?

good point. Also it allows us to drop the `isEmpty` check.

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

PR: https://git.openjdk.org/jdk/pull/10401

Reply via email to