RFR: JDK-8212035 : merge jdk.test.lib.util.SimpleHttpServer with jaxp.library.SimpleHttpServer
Daniel Fuchs
dfuchs at openjdk.java.net
Fri Dec 4 20:51:16 UTC 2020
On Fri, 4 Dec 2020 19:44:33 GMT, Mahendra Chhipa <github.com+34924738+mahendrachhipa at openjdk.org> wrote:
> jaxp.library.SimpleHttpServer
> https://bugs.openjdk.java.net/browse/JDK-8212035
Changes requested by dfuchs (Reviewer).
test/jdk/sun/net/www/protocol/jar/MultiReleaseJarURLConnection.java line 80:
> 78: creator.buildSignedMultiReleaseJar();
> 79:
> 80: server = new SimpleHttpServer(TESTCONTEXT,System.getProperty("user.dir", "."));
Please add space after comma.
test/lib/jdk/test/lib/net/SimpleHttpServer.java line 95:
> 93: return _httpserver.getAddress().getPort();
> 94: }
> 95:
There are many issues with this class - using "localhost" and binding to the wildcard address among others.
Having instance variables that are not final but are accessed by potentially multiple threads is another.
I could also mention not using try-with-resources or the odd _name convention.
It will need to be modernized if you want to put it in jdk.test.lib.net;
-------------
PR: https://git.openjdk.java.net/jdk/pull/1632
More information about the core-libs-dev
mailing list