[jdk20] RFR: 8298340: java/net/httpclient/CancelRequestTest.java fails with AssertionError: Found some subscribers for testPostInterrupt [v2]

Daniel Fuchs dfuchs at openjdk.org
Fri Dec 9 13:57:01 UTC 2022


On Fri, 9 Dec 2022 10:53:11 GMT, Jaikiran Pai <jpai at openjdk.org> 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


More information about the net-dev mailing list