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

Calling a function through a pointer with null parameter fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • workflow-cps-plugin
    • None

      Trying to run the following script:

      def f(def p) {
        echo "called with $p"
      }

      f('a')
      f(null)

      fp = this.&f

      fp('b')
      fp(null)

      The script successfully outputs the direct call with 'a' and null and the call through the function pointer with 'b' but fails when calling with null with the following info:

      java.lang.NoSuchMethodError: No such DSL method 'f' found among steps...
        at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:201)
        at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:122)
      ....

       

            Unassigned Unassigned
            szabi_tolnai Szabolcs Tolnai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: