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

Inconsistent behavior of collect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: pipeline
    • Labels:
    • Environment:
      Jenkins 1.613
      CentOS 6.5
      Installed from Jenkins Repo
      Java x64 1.7.0_75
    • Similar Issues:

      Description

      If this is not the right place, apologies.
      I'm finding an inconsistency when running this code in Jenkins' Script Console (url /script) and in a workflow job:

      bla=['a','b']
      blu=bla.collect { it + 'c' }
      println bla + bla.class.getCanonicalName()
      println blu + blu.class.getCanonicalName()
      

      When running from the console:

      [a, b, java.util.ArrayList]
      [ac, bc, java.util.ArrayList]
      

      When running from the job:

      Started by user BackSlasher
      Running: Print Message
      [a, b, java.util.ArrayList]
      Running: Print Message
      acjava.lang.String
      Running: End of Workflow
      Finished: SUCCESS
      

      The collect method seems to operate only on the first object. Didn't find any obvious reason to why - the Groovy library seems the same.

        Attachments

          Issue Links

            Activity

            Hide
            valones Flávio Augusto Valones added a comment -

            The workflow plugin have trouble with some closures, see JENKINS-26481 for more details.

            Show
            valones Flávio Augusto Valones added a comment - The workflow plugin have trouble with some closures, see JENKINS-26481 for more details.
            Hide
            backslasher Back Slasher added a comment -

            Seems relevant, thanks!

            Show
            backslasher Back Slasher added a comment - Seems relevant, thanks!

              People

              Assignee:
              jglick Jesse Glick
              Reporter:
              backslasher Back Slasher
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: