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) {}`

src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java line 152:

> 150:      * the returned Filter and is executed for each {@code HttpExchange} 
> before
> 151:      * the exchange is handled further.
> 152:      *

Please expand the description to include similar: "before invoking the next 
filter in the chain, or the exchange handler (if this is the final filter in 
the chain)".   Similar comment for afterResponse.

Maybe rename the Consumer do something more general ("consumer") - as the 
number of references to the term "filter" make it a little hard to follow.

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

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

Reply via email to