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

Collection.find returns boolean

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • pipeline

      I have strange problem with workflow script. My simple code look like:

      def tab = [1, 2, 3, 4, 5]
      def five = tab.find{it==5}
      println five
      

      The output of script is:

      Started by user anonymous
      [Workflow] Allocate node : Start
      Running on master in D:\jenkins\jobs\example_workflow\workspace
      [Workflow] node {
      [Workflow] echo
      false
      [Workflow] } //node
      [Workflow] Allocate node : End
      [Workflow] End of Workflow
      Finished: SUCCESS
      

      Why workflow returns boolean value? When I execute this script without workflow it show correct value:

      5
      

            jglick Jesse Glick
            rkuc Rafał Kuć
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: