.plus() method works incorrect

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Problem code:

      script {
      TEST_STRING="oen/two/three"
      TEST_LIST=TEST_STRING.split("/")
      echo "$TEST_LIST"
      TEST_LIST=TEST_LIST.plus(0,"one")
      echo "$TEST_LIST"
      }
      

      Expected output:

      [Pipeline] echo
      08:58:07  [oen, two, three]
      [Pipeline] echo
      08:58:07  [one, two, three]
      

      Current output:

      [Pipeline] echo
      08:58:07  [oen, two, three]
      [Pipeline] echo
      08:58:07  [oen, two, three, 0, one]
      

            Assignee:
            vjuranek
            Reporter:
            gek
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: