If this is not the right place, apologies.
I'm finding an inconsistency when running this code in Jenkins' Script Console (url /script) and in a workflow job:
bla=['a','b'] blu=bla.collect { it + 'c' } println bla + bla.class.getCanonicalName() println blu + blu.class.getCanonicalName()
When running from the console:
[a, b, java.util.ArrayList] [ac, bc, java.util.ArrayList]
When running from the job:
Started by user BackSlasher
Running: Print Message
[a, b, java.util.ArrayList]
Running: Print Message
acjava.lang.String
Running: End of Workflow
Finished: SUCCESS
The collect method seems to operate only on the first object. Didn't find any obvious reason to why - the Groovy library seems the same.
- is related to
-
JENKINS-26481 Mishandling of binary methods accepting Closure
-
- Resolved
-
[JENKINS-28599] Inconsistent behavior of collect
Link |
New:
This issue is related to |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Workflow | Original: JNJira [ 163445 ] | New: JNJira + In-Review [ 197201 ] |
Component/s | New: pipeline-general [ 21692 ] |
Component/s | Original: workflow-plugin [ 18820 ] |
Labels | Original: workflow | New: pipeline workflow |
Labels | Original: pipeline workflow | New: pipeline |