You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/05/21 18:22:04 UTC

[jira] [Commented] (GROOVY-7611) java.util.Optional should evaluate to false if empty

    [ https://issues.apache.org/jira/browse/GROOVY-7611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16018933#comment-16018933 ] 

ASF GitHub Bot commented on GROOVY-7611:
----------------------------------------

GitHub user jwagenleitner opened a pull request:

    https://github.com/apache/groovy/pull/545

    GROOVY-7611: java.util.Optional should evaluate to false if empty (Java8 VMPlugin)

    Target for this would be `2_5_X` and above.  For `2_5_X` and `2_6_X` it would require that the release process build with JDK 8 so would need to backport some of the build checks for Java version to those branches.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jwagenleitner/groovy 7611-Optional

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/545.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #545
    
----
commit 720dced06b1ec447d77b00550b8b299dfe3e18d9
Author: John Wagenleitner <jw...@apache.org>
Date:   2017-05-21T17:16:06Z

    GROOVY-7611: java.util.Optional should evaluate to false if empty

----


> java.util.Optional should evaluate to false if empty
> ----------------------------------------------------
>
>                 Key: GROOVY-7611
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7611
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.4.5
>            Reporter: Christopher Smith
>            Priority: Minor
>
> 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()}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)