Summary
-------
HttpExchange to implement AutoCloseable so that it can be used with try-with-resources statements.
Problem
-------
HttpExchange has a close() method but does not implement AutoCloseable for try-with-resources.
Solution
--------
Retrofit HttpExchange to implement AutoCloseable.
Specification
-------------
--- a/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java Wed Aug 07 10:29:07 2019 +0200
+++ b/src/jdk.httpserver/share/classes/com/sun/net/httpserver/HttpExchange.java Wed Aug 07 16:01:49 2019 +0100
@@ -64,7 +64,7 @@
* @since 1.6
*/
-public abstract class HttpExchange {
+public abstract class HttpExchange implements AutoCloseable {
protected HttpExchange () {
}