-
Bug
-
Resolution: Duplicate
-
Minor
-
None
When invoking a closure created from a method pointer, the following warning is printed in the log:
expected to call org.codehaus.groovy.runtime.MethodClosure.call but wound up catching my.method; see:
https://jenkins.io/redirect/pipeline-cps-method-mismatches/
The code works correctly, but produces this warning:
def method() { // do stuff } def runIt(Closure closure) { closure.call() } runIt(this.&method)
The workaround gets rid of the warning:
def method() {
// do stuff
}
def runIt(Closure closure) {
closure.call()
}
runIt({ method() })
I would prefer to not have to create this extra closure.
My situation is a little more complex than this as the method is from another vars script, but it should be the same situation.
- duplicates
-
JENKINS-59492 False positive CPS mismatch warning when calling a method pointer
-
- Open
-
- is related to
-
JENKINS-28321 Method pointer operator (.&) broken
-
- Resolved
-
[JENKINS-60636] Using method pointers results in warning
Link |
New:
This issue is related to |
Link | New: This issue duplicates JENKINS-59492 [ JENKINS-59492 ] |
Resolution | New: Duplicate [ 3 ] | |
Status | Original: Open [ 1 ] | New: Fixed but Unreleased [ 10203 ] |
Status | Original: Fixed but Unreleased [ 10203 ] | New: Closed [ 6 ] |
Sorry, didn't see the previous issue in my search.