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

Add java.util.Objects.requireNonNull(T, Supplier<String>)

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b87
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      In JDK 7, java.util.Objects included several methods to check for null, including one that took a message to return if a null was found. With lambdas in JDK 8, another variant to include is a requireNonNull method which takes a string supplier instead of a string. That why the cost of creating the string message can be avoided for the non-null case. Note that the lambda capture can have a nonzero cost though.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: