[
https://issues.apache.org/jira/browse/GROOVY-10891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17653438#comment-17653438
]
ASF GitHub Bot commented on GROOVY-10891:
-----------------------------------------
eric-milles commented on PR #1839:
URL: https://github.com/apache/groovy/pull/1839#issuecomment-1368484663
And since `find` and `findAll` are based on groovy truth, to get a default
value, you can just pepper in elvis:
```groovy
def list = [null,false,'',[]]
def result = list.find() ?: 'defaultValue'
assert result == 'defaultValue'
```
> We should have variants of findResult/s with no Closure which use
> Closure.IDENTITY in that case
> -----------------------------------------------------------------------------------------------
>
> Key: GROOVY-10891
> URL: https://issues.apache.org/jira/browse/GROOVY-10891
> Project: Groovy
> Issue Type: Improvement
> Reporter: Paul King
> Priority: Major
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)