RFR: 8330815: Use pattern matching for instanceof in KeepAliveCache

Daniel Jeliński djelinski at openjdk.org
Tue Apr 23 08:56:27 UTC 2024


On Mon, 22 Apr 2024 11:23:59 GMT, Christoph Langer <clanger at openjdk.org> wrote:

> In su.net.www.http.KeepAliveCache we could use pattern matching for instanceof.

I'd prefer this instead:

        if (!(obj instanceof KeepAliveKey kae))
            return false;

because it's more awesome :) but what you propose looks good too.

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

Marked as reviewed by djelinski (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18885#pullrequestreview-2016651386


More information about the net-dev mailing list