Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59492

False positive CPS mismatch warning when calling a method pointer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None
    • Jenkins: 2.176.3
      Pipeline: Groovy: 2.74

      Run this pipeline:

      def hello() {
       echo 'hello'
      }
      
      (this.&hello).call()
      

      The output is as follows:

      [Pipeline] Start of Pipeline
      expected to call org.kohsuke.groovy.sandbox.impl.SandboxedMethodClosure.call but wound up catching WorkflowScript.hello; see: https://jenkins.io/redirect/pipeline-cps-method-mismatches/
      [Pipeline] echo
      hello
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

      As evidenced by the "hello" output, the hello method runs normally, so the warning is a false positive.

            Unassigned Unassigned
            rdonchen_intel Roman Donchenko
            Votes:
            4 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: