On Fri, 9 Dec 2022 10:53:11 GMT, Jaikiran Pai <[email protected]> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Integrated review feedback
>
> src/java.net.http/share/classes/jdk/internal/net/http/Stream.java line 1360:
> 
>> 1358:         if (s instanceof Http2StreamResponseSubscriber<?> sw) {
>> 1359:             if (debug.on()) debug.log("closing response subscriber 
>> stream %s", streamid);
>> 1360:             sw.streamClosed(errorRef.get());
> 
> Given the number of different methods we have and the potential confusion it 
> can cause about which one to use when, do you think in this case we could 
> just reuse the existing ones instead of this new one? Something like:
> 
> if (s instanceof HttpBodySubscriberWrapper sw) {
> ....
>   if (!sw.completed()) {
>      var cause = errorRef.get();
>      var ex = cause == null
>             ? new IOException("stream closed")
>             : cause;
>      complete(ex);
>   }
> }

Excellent suggestion. Done.

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

PR: https://git.openjdk.org/jdk20/pull/3

Reply via email to