If you have a Java object array (as opposed to a list, as with typical Groovy code) and try to pass it as an argument to a CPS-transformed method, only the first element arrives, rather than an array.
Workarounds:
- wrap the array in Arrays.asList before passing it, and treat the argument as a List
- annotate the method as @NonCPS (assuming it is not calling any steps)
- is duplicated by
-
JENKINS-29990 NPE from CpsCallableInvocation.<init> when passing null to one-arg method
-
- Resolved
-
-
JENKINS-32122 A List passed to a function is received as a String
-
- Resolved
-
- links to
[JENKINS-32062] Arrays may not be passed directly to methods
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Remote Link | New: This issue links to "groovy-cps PR 20 (Web Link)" [ 13599 ] |
Link |
New:
This issue is duplicated by |
Remote Link | New: This issue links to "PR 295 (Web Link)" [ 13741 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |
Link |
New:
This issue is duplicated by |
Workflow | Original: JNJira [ 167538 ] | New: JNJira + In-Review [ 198225 ] |
Component/s | New: pipeline-general [ 21692 ] |
Component/s | Original: workflow-plugin [ 18820 ] |