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

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

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P5
    • Resolution: Fixed
    • None
    • 18
    • core-libs
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: