On Tue, 18 May 2021 09:34:25 GMT, Julia Boes <jb...@openjdk.org> wrote:
> The filter operation `Consumer` that is passed to the factory methods can > throw an unchecked exception. This change adds a note on the exception > handling in that case. It also adds a clarification to `Filter::afterHandler` > on the relation of the filter operation and the client receiving the response. Marked as reviewed by dfuchs (Reviewer). src/jdk.httpserver/share/classes/com/sun/net/httpserver/Filter.java line 213: > 211: * Doing so is likely to fail, since the exchange has commonly been > handled > 212: * before the {@code operation} is invoked. Correspondingly, the > client > 213: * commonly receives the response before the filter operation is > executed. I'd rather replace `commonly` with `may`: this is essentially racy and you cannot assume that any of the outcome is more likely than the other. * [...] Correspondingly, the client * may receive the response before the filter operation is executed. ------------- PR: https://git.openjdk.java.net/jdk/pull/4085