-
Improvement
-
Resolution: Duplicate
-
Major
Currently, putting the following code in a Jenkinsfile will raise a UnsupportedOperationException: Calling public static java.util.List org.codehaus.groovy.runtime.DefaultGroovyMethods.find(java.util.List,groovy.lang.Closure) on a CPS-transformed closure is not yet supported (JENKINS-26481); encapsulate in a @NonCPS method, or use Java-style loops
node { tmp = [ 'A', 'B' ].find { it == 'B' } echo tmp }
However, if this code is used without @NonCPS in a shared library, it will fail silently and tmp will be false.
- duplicates
-
JENKINS-31314 Running asynchronous code inside a @NonCPS method should fail cleanly
-
- Resolved
-
-
JENKINS-41189 [Pipeline] Some non-CPS transformable code will not throw errors
-
- Resolved
-
- relates to
-
JENKINS-26481 Mishandling of binary methods accepting Closure
-
- Resolved
-
[JENKINS-42024] Silent error : UnsupportedOperationExceptions are not raised when using each/find
Description |
Original:
Currently, putting the following code in a Jenkinsfile will raise a {{UnsupportedOperationException: Calling public static java.util.List org.codehaus.groovy.runtime.DefaultGroovyMethods.find(java.util.List,groovy.lang.Closure) on a CPS-transformed closure is not yet supported ( {code} node { tmp = [ 'A', 'B' ].find { it == 'B' } echo tmp } {code} Howerver, if this code is used without {{@NonCPS}} in a shared library, it will fail silently and {{tmp}} will be {{false}}. |
New:
Currently, putting the following code in a Jenkinsfile will raise a {{UnsupportedOperationException: Calling public static java.util.List org.codehaus.groovy.runtime.DefaultGroovyMethods.find(java.util.List,groovy.lang.Closure) on a CPS-transformed closure is not yet supported ( {code} node { tmp = [ 'A', 'B' ].find { it == 'B' } echo tmp } {code} However, if this code is used without {{@NonCPS}} in a shared library, it will fail silently and {{tmp}} will be {{false}}. |
Link |
New:
This issue duplicates |
Component/s | New: workflow-cps-plugin [ 21713 ] | |
Component/s | Original: workflow-cps-global-lib-plugin [ 21714 ] | |
Issue Type | Original: Bug [ 1 ] | New: Improvement [ 4 ] |
Link |
New:
This issue relates to |
Labels | New: diagnostics |
Link |
New:
This issue duplicates |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |