Relates :
|
|
Relates :
|
|
Relates :
|
The java.util.Objects class added in JDK 7 includes a pair of requireNonNull methods, one which takes one argument to be checked and another which takes a message for the NPE if one is thrown. The JDK code would benefit from using these methods in lieu of the more verbose "if (o == null) throw new NullPointerException..."