[
https://issues.apache.org/jira/browse/GROOVY-10891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17653374#comment-17653374
]
Paul King commented on GROOVY-10891:
------------------------------------
{quote}This ticket is title-only, which is a red flag for me.
{quote}
Apologies, it seemed like a fairly obvious hole in the functionality to me. I
am a big fan of consistency. I guess I shouldn't assume other folks are on the
same page.
{quote}If you just want an item or items there is find and findAll
{quote}
findResult/findResults are a mirror of find/findAll. The former treat null only
as non-matching whereas the latter apply Groovy truth. They were introduced
because not everyone wants to apply Groovy truth all of the time.
{quote}There was much discussion ... back in Feb 2019
{quote}
If I had investigated more fully, I would have suggested this PR to you back
then. Having said that, I would regard the non-default variants as higher
priority. It is the former which are showing up in the data science code that I
have been writing recently. I have been adding Closure.IDENTITY myself but it
adds visual noise that I would prefer to eliminate. The default value cases can
use the Elvis operator but it doesn't flow as nicely in fluent API scenarios
where you want to have multiple data science steps follow on after each other.
And again there is that consistency thing which suggests adding them to match
the rest of the API. Folks aren't obliged to use that variant if they have
cases where the Elvis operator works just as nicely.
> 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)