On Fri, 16 May 2025 18:43:33 GMT, Phil Race <p...@openjdk.org> wrote:
>It was added to avoid having to explicitly retroactively specify @throws NPE >on however many methods didn't actually declare it in their spec and >"accidentally" threw NPE. No, in many cases NPE was explicitly added to many methods in that packages, even if npe had not been thrown before. It is better to use NPE. Check how many "@throws NullPointerException if XXX is {@code null}" is in that code, and compare that with usage of IllegalArgumentException. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093662600