java.util.Objects.requireNonNull: an opportunity for NullArgumentException?

Martin Desruisseaux martin.desruisseaux at
Wed Feb 23 14:55:33 UTC 2011

Hello all

I apologize if this question was already debated previously. I just wonder: 
since JDK 7 defines an Object.requireNonNull(…) method for explicit checks of 
argument value, does the Project-Coin expert group has considered the addition 
of an explicit NullArgumentException extends NullPointerException for making 
clear that this exception is the result of an argument check rather than some 
bug hidden in the middle of a code?

Some kind of NullArgumentException seems a common addition in many libraries 
built on top of JDK. To name just a few from a quick Google search:

A blog:



More information about the core-libs-dev mailing list