Consider the following script:
node { fn("This should only be one string") } def fn (String... strs) { echo "${strs.size()}" }
This results in the following output:
Running: Allocate node : Body : Start Running: Print Message 30 Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow Finished: SUCCESS
Under a groovy console the result is as we'd expect, there is one String in the array of Strings.
def fn (String... strs) { println "${strs.size()}" } fn("This should only be one string") return
Result:
1
I'm guessing this is just a bug?
In the meantime is there a workaround? I'd like a function to handle an array of strings, and need to loop through the Strings, not individual characters.
- is blocking
-
JENKINS-25979 Finish Groovy CPS coverage
- Open