On Sat, 8 Jul 2023 06:15:13 GMT, Vyom Tewari <[email protected]> wrote:

> Please review the code change for 
> [JDK-8306040](https://bugs.openjdk.org/browse/JDK-8306040). In the overridden 
> "available" method of "HttpResponseInputStream" we are returning 1 after 
> exploring all the code path.

src/java.net.http/share/classes/jdk/internal/net/http/ResponseSubscribers.java 
line 541:

> 539:             Iterator<?> iterator = currentListItr;
> 540:             if (iterator != null && iterator.hasNext()) return 1;
> 541:             if (!buffers.isEmpty() && buffers.peek() != LAST_LIST ) 
> return 1;

Should probably be:


if (iterator != null && iterator.hasNext() && Utils.hasRemaining(buffers)) 
return 1;

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14810#discussion_r1257850223

Reply via email to