Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14846

Avoid use of Optional.ofNullable.orElse in the same line

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 9.0
    • None
    • None

    Description

      Optional was meant to be used in public APIs to convey to the caller that they really need to null-check, not as an internal class to avoid doing our own null checks. There are better methods in Objects for that if we want them.

      See also Brian Goetz at JavaOne - https://youtu.be/MFzlgAuanU0?t=2719

      Attachments

        Issue Links

          Activity

            People

              mdrob Mike Drob
              mdrob Mike Drob
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m