JDK-7041258 : Use j.u.Object.requireNonNull in the JDK codebase
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2011-05-02
  • Updated: 2018-08-14
  • Resolved: 2018-08-14
Related Reports
Relates :  
Relates :  
Relates :  
Description
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..."