On Fri, 16 May 2025 20:50:14 GMT, Sergey Bylokhov <s...@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.

So even if some parts ofthe fix up did add NPE after the fact - documenting 
what was already happening by accident doesn't seem to support a clear design 
desicion or an essential need to use NPE in this case

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093669729

Reply via email to