You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2023/06/09 16:34:00 UTC

[jira] [Reopened] (GROOVY-11076) @ClosureParams for StringGroovyMethods.replaceFirst and StringGroovyMethods.replaceAll wrong

     [ https://issues.apache.org/jira/browse/GROOVY-11076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles reopened GROOVY-11076:
----------------------------------

> @ClosureParams for StringGroovyMethods.replaceFirst and StringGroovyMethods.replaceAll wrong
> --------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-11076
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11076
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 3.0.17
>            Reporter: Björn Kautler
>            Assignee: Eric Milles
>            Priority: Major
>
> The {{@ClosureParams}} for {{StringGroovyMethods.replaceFirst}} and {{StringGroovyMethods.replaceAll}} seems to be wrong. It says {{​&#123;"List<String>", "String[]"&#125;​}}, so without static compilation IntelliJ shows a warning and with static compilation an error for the {{String it}} parts of
> {code:groovy}
> def pascalCasedWorkflowName = workflowName
>     .replaceAll(/-\w/) { String it -> it[1].toUpperCase() }
>     .replaceFirst(/^\w/) { String it -> it[0].toUpperCase() }
> {code}
> while it compiles and works perfectly fine. I'd guess it should be {{​&#123;"String", "List<String>", "String[]"&#125;​}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)