[
https://issues.apache.org/jira/browse/GROOVY-11858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11858.
----------------------------------
Fix Version/s: 6.0.0-alpha-1
Resolution: Fixed
> Splitting string inside tap closure throws NullPointerException
> ---------------------------------------------------------------
>
> Key: GROOVY-11858
> URL: https://issues.apache.org/jira/browse/GROOVY-11858
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 5.0.4
> Reporter: Evan Shaw
> Assignee: Eric Milles
> Priority: Major
> Fix For: 6.0.0-alpha-1
>
>
> This code throws an exception:
> {code:groovy}
> 'a b c'.tap { println(split()) }
> {code}
> The exception message:
> {code}
> NullPointerException: Cannot invoke
> "groovy.lang.Closure.getMaximumNumberOfParameters()" because "wrapped" is null
> {code}
> If I pass an argument to split, it works as expected:
> {code:groovy}
> 'a b c'.tap { println(split(' ')) }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)