You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/12/10 11:02:00 UTC

[jira] [Comment Edited] (GROOVY-8406) DefaultGroovyMethods missing Array support

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

Paul King edited comment on GROOVY-8406 at 12/10/17 11:01 AM:
--------------------------------------------------------------

If that is the case, here is the complete list of things which I believe are missing.

I think we could supply additional {{T[]}} variants for the following {{Object}} variants:
{code}
any(Closure closure)
collect(Closure transform)
collect(Collection collector, Closure transform)
every(Closure closure)
findIndexOf(Closure closure)
findIndexOf(int startIndex, Closure closure)
findIndexValues(Closure closure)
findIndexValues(Number startIndex, Closure closure)
findLastIndexOf(Closure closure)
findLastIndexOf(int startIndex, Closure closure)
findResult(Closure closure)
findResult(Object defaultResult, Closure closure)
split(Closure closure)
{code}

In addition, for sum methods taking a closure we currently have {{Iterable}}, {{Iterator<Object>}} and {{Object[]}} variants.
We could instead have {{Iterable<T>}}, {{Iterator<T>}} and {{T[]}} variants of the following methods:
{code}
sum(Closure closure)
sum(Object initialValue, Closure closure)
{code}
We need to annotate the closure parameter  in each case with {{@ClosureParams(FirstParam.Component.class)}}.


was (Author: paulk):
If that is the case, here is the complete list of things which I believe are missing.

I think we could supply additional {{T[]}} variants for the following {{Object}} variants:
{code}
any(Closure closure)
collect(Closure transform)
collect(Collection collector, Closure transform)
every(Closure closure)
findIndexOf(Closure closure)
findIndexOf(int startIndex, Closure closure)
findIndexValues(Closure closure)
findIndexValues(Number startIndex, Closure closure)
findLastIndexOf(Closure closure)
findLastIndexOf(int startIndex, Closure closure)
findResult(Closure closure)
findResult(Object defaultResult, Closure closure)
split(Closure closure)
{code}

In addition, for sum methods taking a closure we currently have {{Iterable}}, {{Iterator<Object>}} and {{Object[]}} variants.
We could instead have {{Iterable<T>}}, {{Iterator<T>}} and {{T[]}} variants of the following methods:
{code}
sum(Closure closure)
sum(Object initialValue, Closure closure)
{code}


> DefaultGroovyMethods missing Array support
> ------------------------------------------
>
>                 Key: GROOVY-8406
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8406
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.5.0-beta-1
>            Reporter: Nathan Harvey
>            Priority: Minor
>              Labels: easyfix
>
> The methods every, any, and collect support instances of Iterable and Iterator, but do not include equivalent methods for support arrays.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)