Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7041258

Use j.u.Object.requireNonNull in the JDK codebase

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 8
    • core-libs
    • None
    • generic
    • generic

      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..."

            darcy Joe Darcy
            darcy Joe Darcy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: