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/05/02 02:04:17 UTC
[jira] [Closed] (GROOVY-7440) Improve ClosureParam type hints for
various splitEachLine GroovyMethod methods
[ https://issues.apache.org/jira/browse/GROOVY-7440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-7440.
-----------------------------
> Improve ClosureParam type hints for various splitEachLine GroovyMethod methods
> ------------------------------------------------------------------------------
>
> Key: GROOVY-7440
> URL: https://issues.apache.org/jira/browse/GROOVY-7440
> Project: Groovy
> Issue Type: Bug
> Reporter: Paul King
> Assignee: Paul King
> Fix For: 2.5.0-alpha-1
>
>
> Currently, the {{splitEachLine}} extension methods in different files have slightly different type hints:
> {code}
> NioGroovyMethods: @ClosureParams(value = FromString.class, options = "List<String>")
> StringGroovyMethods: @ClosureParams(value = FromString.class, options = "List<String>")
> IOGroovyMethods: @ClosureParams(value = FromString.class, options = "List<String>")
> ResourceGroovyMethods: @ClosureParams(value=SimpleType.class, options="java.lang.String[]")
> {code}
> The {{List<String>}} variant is the best match but the type checker is smart enough to handle some vararg cases too, so the following is actually better:
> {code}
> @ClosureParams(value=FromString.class,options={"List<String>","String[]"},conflictResolutionStrategy=PickFirstResolver.class)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)