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

Use Optional.empty() instead of ofNullable(null) in HttpResponse.BodySubscribers.discarding

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 18
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b19

      Description

      Usage of Optional.ofNullable is unnecessary when value is known. If it's null value Optional.empty() should be preferred, as it doesn't perform redundant null check.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              aturbanov Andrey Turbanov
              Reporter:
              aturbanov Andrey Turbanov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: