RFR: JDK-8273142 : Remove dependancy of TestHttpServer, HttpTransaction, HttpCallback from open/test/jdk/sun/net/www/protocol/http/ tests [v2]

Michael McMahon michaelm at openjdk.java.net
Wed Sep 29 19:27:47 UTC 2021


On Wed, 29 Sep 2021 13:45:43 GMT, Mahendra Chhipa <github.com+34924738+mahendrachhipa at openjdk.org> wrote:

>> test/jdk/sun/net/www/protocol/http/B6296310.java line 103:
>> 
>>> 101:          try(PrintWriter pw = new PrintWriter(trans.getResponseBody())) {
>>> 102:             pw.print("");
>>> 103:          }
>> 
>> Not sure what the purpose of this block is, which apparently writes no bytes to the OutputStream?
>
> Hi @Michael-Mc-Mahon , In my understanding purpose of this block is to return a file with no contents.(Empty file).

I think it would be simpler to replace lines 101-103 just with `trans.close()`

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

PR: https://git.openjdk.java.net/jdk/pull/5352


More information about the net-dev mailing list