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

Creating a string supplier should cost more than creating a string

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8, 11, 17
    • core-libs
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      In the javadoc for Objects.requireNonNull(obj, messageSupplier) it states:
      "While this may confer a performance advantage in the non-null case, when deciding to call this method care should be taken that the costs of creating the message supplier are less than the cost of just creating the string message directly."

      Creating a string message directly should cost less than creating the message supplier so it should say:
      "While this may confer a performance advantage in the non-null case, when deciding to call this method care should be taken that the costs of creating the message supplier are more than the cost of just creating the string message directly."


            darcy Joe Darcy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: