Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7611

java.util.Optional should evaluate to false if empty

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.5
    • 2.5.0-beta-1
    • None

    Description

      In the spirit of the rest of the Groovy truth semantics, I suggest that an empty java.util.Optional, which is essentially a stream-safe equivalent of null, should evaluate to false: asBoolean() should simply delegate to isPresent().

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jwagenleitner John Wagenleitner
            chrylis Christopher Smith
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment