On Tue, 13 Apr 2021 15:39:17 GMT, Julia Boes <jb...@openjdk.org> wrote:
> Add two static factory methods to com.sun.net.httpserver that facilitate the > creation of pre- and post-processing Filters: > > `public static Filter beforeResponse(String description, > Consumer<HttpExchange> filterImpl) {}` > `public static Filter afterResponse(String description, > Consumer<HttpExchange> filterImpl) {}` test/jdk/com/sun/net/httpserver/FilterTest.java line 63: > 61: ch.setLevel(Level.ALL); > 62: logger.addHandler(ch); > 63: } Is there a concern that the Logger will be GC'd before it will be used? Since the reference is not stored anywhere, it can be GC'd immediately. ------------- PR: https://git.openjdk.java.net/jdk/pull/3468