RFR: 8329760: Add indexOf(Predicate<? super E> filter) to java..util.List interface

xxDark duke at openjdk.org
Thu Apr 18 22:00:14 UTC 2024


On Tue, 9 Apr 2024 21:48:23 GMT, Evemose <duke at openjdk.org> wrote:

> One possible workaround is to temporally (for an intermidiate period) or permanently delegate null value handing to indexOf(Object), which seems odd for me to me tbh, although it preserves source compatibility.

This does not solve the problem though. Source compatibility would still be broken as one would still need to add casts everywhere, or am I misinterpreting something?
> he concern about change in behaviour of indexOf(null) is completely valid, although indexOf(null) is kind of exotic scenario.

See [this](https://github.com/search?q=%22indexOf%28null%29%22+language%3AJava+&type=code) and [that](https://github.com/search?q=%22lastIndexOf%28null%29%22+language%3AJava+&type=code) query.

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

PR Comment: https://git.openjdk.org/jdk/pull/18639#issuecomment-2046118678


More information about the core-libs-dev mailing list